Generate line numbers for function call parameters

Before this fix line numbers for function call arguments were not generated,
 so if argument was on another line than function call it was
 impossible to stop on argument line during debugging.
 Now line number for each argument is generated if necessary
 (another line than function call line).

 #KT-17144 Fixed
This commit is contained in:
Mikhael Bogdanov
2017-04-16 15:05:47 +02:00
parent b60efab62e
commit 708bfdbd5f
11 changed files with 51 additions and 34 deletions
+13 -13
View File
@@ -5,8 +5,8 @@ package test
fun testProperLineNumberAfterInline(): String {
var exceptionCount = 0;
try {
checkEquals(test(),
"12")
fail(inlineFun(),
"12")
}
catch(e: AssertionError) {
val entry = (e as java.lang.Throwable).getStackTrace()!!.get(1)
@@ -18,8 +18,8 @@ fun testProperLineNumberAfterInline(): String {
}
try {
checkEquals("12",
test())
fail("12",
inlineFun())
}
catch(e: AssertionError) {
val entry = e.stackTrace!![1]
@@ -36,13 +36,13 @@ fun testProperLineNumberAfterInline(): String {
fun testProperLineForOtherParameters(): String {
var exceptionCount = 0;
try {
checkEquals(test(),
fail())
fail(inlineFun(),
fail())
}
catch(e: AssertionError) {
val entry = e.stackTrace!![1]
val actual = "${entry.getFileName()}:${entry.getLineNumber()}"
if ("simpleCallWithParams.kt:39" != actual) {
if ("simpleCallWithParams.kt:40" != actual) {
return "fail 3: ${actual}"
}
exceptionCount++
@@ -50,8 +50,8 @@ fun testProperLineForOtherParameters(): String {
}
try {
checkEquals(fail(),
test())
fail(fail(),
inlineFun())
}
catch(e: AssertionError) {
val entry = e.stackTrace!![1]
@@ -63,7 +63,7 @@ fun testProperLineForOtherParameters(): String {
}
try {
checkEquals(fail(), test())
fail(fail(), inlineFun())
}
catch(e: AssertionError) {
val entry = e.stackTrace!![1]
@@ -75,7 +75,7 @@ fun testProperLineForOtherParameters(): String {
}
try {
checkEquals(fail(), test())
fail(fail(), inlineFun())
}
catch(e: AssertionError) {
val entry = e.stackTrace!![1]
@@ -97,11 +97,11 @@ fun box(): String {
return testProperLineForOtherParameters()
}
public fun checkEquals(p1: String, p2: String) {
public fun fail(p1: String, p2: String) {
throw AssertionError("fail")
}
inline fun test(): String {
inline fun inlineFun(): String {
return "123"
}