Drop obsolete TODO during FIR building

This commit is contained in:
Mikhail Glukhikh
2021-03-03 08:55:48 +03:00
parent 8e9dfc23b6
commit 45ba035431
2 changed files with 3 additions and 5 deletions
@@ -89,6 +89,7 @@ inline fun isClassLocal(classNode: LighterASTNode, getParent: LighterASTNode.()
parent?.tokenType == KT_FILE -> return true
parent?.tokenType == CLASS_BODY && !(grandParent?.tokenType == OBJECT_DECLARATION && grandParent?.getParent()?.tokenType == OBJECT_LITERAL) -> return true
parent?.tokenType == BLOCK && grandParent?.tokenType == SCRIPT -> return true
// NB: enum entry nested classes are considered local by FIR design (see discussion in KT-45115)
parent?.tokenType == ENUM_ENTRY -> return true
}
}
@@ -793,11 +793,8 @@ class RawFirBuilder(
override fun visitClassOrObject(classOrObject: KtClassOrObject, data: Unit): FirElement {
return withChildClassName(
classOrObject.nameAsSafeName,
classOrObject.isLocal
// TODO: currently enum entry initializer is represented in FIR as an FirAnonymousObject. Because of this, all
// nested declarations are now marked local. This causes the FirNestedClassChecker to ignore some invalid programs.
// See KT-45115
|| classOrObject.getStrictParentOfType<KtEnumEntry>() != null
// NB: enum entry nested classes are considered local by FIR design (see discussion in KT-45115)
isLocal = classOrObject.isLocal || classOrObject.getStrictParentOfType<KtEnumEntry>() != null
) {
val classKind = when (classOrObject) {
is KtObjectDeclaration -> ClassKind.OBJECT