line number codegen tests
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
{
|
||||
test.lineNumber()
|
||||
}()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package test
|
||||
|
||||
public fun lineNumber(): Int = 0
|
||||
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
val prop = test.lineNumber()
|
||||
|
||||
fun foo() {
|
||||
test.lineNumber()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
class object {
|
||||
val prop = test.lineNumber()
|
||||
|
||||
fun foo(): Int {
|
||||
return test.lineNumber()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fun foo(param: Int = test.lineNumber()) {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
enum class E {
|
||||
E1
|
||||
|
||||
fun foo() = {
|
||||
test.lineNumber()
|
||||
}
|
||||
|
||||
val prop = test.lineNumber()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo() {
|
||||
for (i in 0..test.lineNumber()) {
|
||||
test.lineNumber()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
fun foo() {
|
||||
if (test.lineNumber() > 0) {
|
||||
test.lineNumber()
|
||||
}
|
||||
|
||||
if (test.lineNumber() > 0) else {
|
||||
test.lineNumber()
|
||||
}
|
||||
|
||||
if (test.lineNumber() > 0) {
|
||||
test.lineNumber()
|
||||
} else {
|
||||
test.lineNumber()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun foo() {
|
||||
test.lineNumber()
|
||||
fun bar() {
|
||||
test.lineNumber()
|
||||
}
|
||||
test.lineNumber()
|
||||
bar()
|
||||
test.lineNumber()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
object A {
|
||||
fun foo() = test.lineNumber()
|
||||
|
||||
val prop = test.lineNumber()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class A {
|
||||
val prop : Int
|
||||
get() {
|
||||
return test.lineNumber()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<String>) {
|
||||
test.lineNumber()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo() = test.lineNumber()
|
||||
|
||||
val prop = test.lineNumber()
|
||||
@@ -0,0 +1,7 @@
|
||||
trait A {
|
||||
fun foo() = test.lineNumber()
|
||||
|
||||
fun bar(): Int {
|
||||
return test.lineNumber()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
try {
|
||||
test.lineNumber()
|
||||
} catch (e: Exception) {
|
||||
test.lineNumber()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun foo() {
|
||||
while (test.lineNumber() > 0) {
|
||||
test.lineNumber()
|
||||
}
|
||||
|
||||
do {
|
||||
test.lineNumber()
|
||||
} while (test.lineNumber() > 0)
|
||||
}
|
||||
Reference in New Issue
Block a user