JVM IR: Do not generate DefaultImpls if it's empty. This revealed that InterfaceDelegationLowering was relying on the presence of DefaultImpls even when empty. Hence, simply dropping it from InterfaceLowering was not trivial. Moved default delegation in DefaultImpls to SuperType.DefaultImpls to InterfaceLowering. Clean up logic considerably, and document inter-phase dependencies.

This commit is contained in:
Kristoffer Andersen
2019-10-01 12:35:04 +02:00
committed by max-kammerer
parent cc6252098f
commit 9d1d6a7b1f
9 changed files with 228 additions and 119 deletions
@@ -0,0 +1,22 @@
// !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface A {
@JvmDefault
fun foo(x: Int = 0): Int {
return x
}
}
// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: A, DefaultImpls
// FLAGS: ACC_FINAL, ACC_STATIC, ACC_PUBLIC
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: A, foo$default
// FLAGS: ACC_PUBLIC, ACC_SYNTHETIC, ACC_STATIC
// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: A$DefaultImpls, foo$default
// FLAGS: ACC_PUBLIC, ACC_SYNTHETIC, ACC_STATIC