KT-4119: Back-end (JVM) Internal error on code with local extensions

#KT-4119 Fixed
This commit is contained in:
Mikhael Bogdanov
2013-10-24 16:32:56 +04:00
parent 88a43fac5f
commit 604be8e0c1
4 changed files with 48 additions and 0 deletions
@@ -0,0 +1,12 @@
fun foo(f: (Int?) -> Int): Int {
return f(0)
}
fun box() : String {
fun Int?.plus(a:Int) : Int = a!! + 2
if (foo { it + 1} != 3) return "Fail 1"
if (foo { it plus 1} != 3) return "Fail 2"
return "OK"
}
@@ -0,0 +1,19 @@
fun box(): String {
fun Int.foo(a: Int): Int = a + 2
val s = object {
fun test(): Int {
return 1 foo 1
}
}
fun local(): Int {
return 1 foo 1
}
if (s.test() != 3) return "Fail"
if (local() != 3) return "Fail"
return "OK"
}