[Raw FIR] Keep the name of an anonymous object of enum entry in classId of its nested classes
It is needed to have an ability to distinguish those two cases in FIR2IR: Without this change the following tests fail: - org.jetbrains.kotlin.test.runners.codegen.FirPsiBlackBoxCodegenTestGenerated.Enum - testEnumEntryReferenceFromInnerClassConstructor1() - testEnumEntryReferenceFromInnerClassConstructor2() - testEnumEntryReferenceFromInnerClassConstructor3() - testInnerClassMethodInEnumEntryClass() - testInnerClassMethodInEnumEntryClass2() - testKt9711_2() - testDeepInnerClassInEnumEntryClass() - testKt7257_boundReference1() - testInnerClassInEnumEntryClass() - testKt44744_innerClass()
This commit is contained in:
committed by
Space Team
parent
000c24fc69
commit
22f55b3dc4
+1
-4
@@ -419,8 +419,6 @@ class LightTreeRawFirDeclarationBuilder(
|
||||
}
|
||||
}
|
||||
|
||||
private val LighterASTNode.isDirectlyInsideEnumEntry get() = getParent()?.getParent()?.elementType == ENUM_ENTRY
|
||||
|
||||
/***** DECLARATIONS *****/
|
||||
/**
|
||||
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parseClassOrObject
|
||||
@@ -460,8 +458,7 @@ class LightTreeRawFirDeclarationBuilder(
|
||||
}
|
||||
|
||||
val className = identifier.nameAsSafeName(if (modifiers.isCompanion()) "Companion" else "")
|
||||
val isLocalWithinParent = classNode.isDirectlyInsideEnumEntry
|
||||
|| classNode.getParent()?.elementType != CLASS_BODY && isClassLocal(classNode) { getParent() }
|
||||
val isLocalWithinParent = classNode.getParent()?.elementType != CLASS_BODY && isClassLocal(classNode) { getParent() }
|
||||
val classIsExpect = modifiers.hasExpect() || context.containerIsExpect
|
||||
|
||||
return withChildClassName(className, isExpect = classIsExpect, isLocalWithinParent) {
|
||||
|
||||
Reference in New Issue
Block a user