KT-5699 VerifyError in inlines

#KT-5699 Fixed
This commit is contained in:
Michael Bogdanov
2014-08-29 10:15:49 +04:00
parent d80907543f
commit 83eb983e08
10 changed files with 118 additions and 6 deletions
@@ -0,0 +1,35 @@
import test.*
fun testExtensionInClass() : String {
var res = with(Z(1)) { "1".run("OK") }
if (res != "1OK") return "failed in class 1: $res"
res = with(Z(1)) { "1".run() }
if (res != "1null") return "failed in class 2: $res"
res = with(Z(2)) { "3".run("OK", {(a, b) -> a + b + value }, 1) }
if (res != "OK123") return "failed in class 3: $res"
res = with(Z(3)) { "4".run(lambda = {(a, b) -> a + b + value }) }
if (res != "034") return "failed in class 4: $res"
return "OK"
}
fun box(): String {
var res = "1".run("OK")
if (res != "1OK") return "failed 1: $res"
res = "1".run()
if (res != "1null") return "failed 2: $res"
res = "3".run("OK", {(a, b) -> a + b}, 1)
if (res != "OK13") return "failed 3: $res"
res = "4".run(lambda = {(a, b) -> a + b})
if (res != "04") return "failed 4: $res"
return testExtensionInClass()
}