K2 Scripting, Fir2Ir: allow out of order supertypes declaration

fix script declarations registration logic in Fir2Ir to allow
supertypes of a class to be defined later than the class itself.

#KT-64534 fixed
This commit is contained in:
Ilya Chernikov
2024-03-15 15:08:49 +01:00
committed by Space Team
parent f18aa5e70f
commit 0df3a37303
9 changed files with 76 additions and 1 deletions
@@ -0,0 +1,24 @@
MODULE main
CLASS Script.class
CLASS METADATA
K1
<init>([Ljava/lang/String;)V
K2
---
Property: class.metadata.superTypes
K1
[kotlin/script/templates/standard/ScriptTemplateWithArgs]
K2
[]
Property: class.metadata.contextReceiverTypes
K1
[]
K2
[kotlin/script/templates/standard/ScriptTemplateWithArgs]
CLASS Script$A.class
CLASS METADATA
Property: class.metadata.superTypes
K1
[Script.B, Script.C]
K2
[B, C]
+14
View File
@@ -0,0 +1,14 @@
// TARGET_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_ABI_K1_K2_DIFF: KT-63963, KT-63964, KT-63960
// FILE: test.kt
fun box(): String = "OK"
// FILE: script.kts
class A : B, C {}
interface B
interface C