IR: skip script inner classes in LDL

#KT-49012 fixed
This commit is contained in:
Ilya Chernikov
2021-09-30 13:57:49 +02:00
parent 7e86f5dcd9
commit fd2929d2c5
4 changed files with 43 additions and 0 deletions
@@ -953,6 +953,8 @@ class LocalDeclarationsLowering(
super.visitConstructor(declaration, data)
if (!isScriptMode && !declaration.constructedClass.isLocalNotInner()) return
// Inner classes in scripts are handled properly in the InnerClassesLowering
if (isScriptMode && declaration.constructedClass.isInner) return
// LDL doesn't work on the enums because local enums are not allowed, so skipping them in scripts too
if (isScriptMode && declaration.constructedClass.kind == ClassKind.ENUM_CLASS) return
@@ -964,6 +966,8 @@ class LocalDeclarationsLowering(
super.visitClass(declaration, data.withCurrentClass(declaration))
if (!isScriptMode && !declaration.isLocalNotInner()) return
// Inner classes in scripts are handled properly in the InnerClassesLowering
if (isScriptMode && declaration.isInner) return
// LDL doesn't work on the enums because local enums are not allowed, so skipping them in scripts too
if (isScriptMode && declaration.kind == ClassKind.ENUM_CLASS) return