Generate synthetic functions for local functions with default values, by

re-ordering the lowering phases.

The changes in InterfaceLowering are necessary so that IrElements that
target the removed functions are re-targeted to the new functions in
DefaultImpls. This affects local functions in interface functions since
now LocalDeclarationsLowering comes before InterfaceLowering.
This commit is contained in:
Mark Punzalan
2019-06-26 21:01:06 -07:00
committed by max-kammerer
parent d2f1852c5e
commit 1abdf0561a
26 changed files with 239 additions and 89 deletions
@@ -0,0 +1,12 @@
class C() {
fun box(): Int {
fun local(i: Int = 1): Int {
return i
}
return local()
}
}
fun box(): String {
return if (C().box() != 1) "fail" else "OK"
}