Generate linenumber if needed after inlining

This commit is contained in:
Michael Bogdanov
2015-03-24 12:48:50 +03:00
parent 8cd496556c
commit c582b1d9ce
12 changed files with 399 additions and 2 deletions
@@ -0,0 +1,21 @@
fun box(){
checkEquals(test(),
fail())
checkEquals(fail(),
test())
}
public fun checkEquals(p1: String, p2: String) {
throw AssertionError("fail")
}
inline fun test() : String {
return "123"
}
fun fail() : String {
throw AssertionError("fail")
}
// 2 14 2 5 14 5 7 10 14 18
@@ -0,0 +1,19 @@
fun String.execute(p: String) = this + p
fun box(){
test() execute
fail()
fail() execute
test()
}
inline fun test() : String {
return "123"
}
fun fail() : String {
throw AssertionError("fail")
}
// 1 4 12 4 7 12 7 9 12 16
@@ -0,0 +1,21 @@
fun box(){
test(test("1", "2"),
fail())
test(fail(),
test("1", "2"))
}
public fun checkEquals(p1: String, p2: String) {
throw AssertionError("fail")
}
inline fun test(p: String, s: String) : String {
return "123"
}
fun fail() : String {
throw AssertionError("fail")
}
//2 14 2 14 5 14 5 14 7 10 14 18
@@ -0,0 +1,17 @@
fun box(){
test() +
fail()
fail() +
test()
}
inline fun test() : String {
return "123"
}
fun fail() : String {
throw AssertionError("fail")
}
// 2 10 3 5 6 10 7 10 14