Report error on indirect inline cycles

This commit is contained in:
Michael Bogdanov
2015-05-20 11:48:05 +03:00
parent a671d684c9
commit ef4981b0ef
15 changed files with 151 additions and 9 deletions
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/inlineCycle.kt
-output
$TEMP_DIR$
+20
View File
@@ -0,0 +1,20 @@
inline fun a(l: () -> Unit) {
b(l)
//check taht nested not recognized as cycle
c {
c {
}
}
}
inline fun b(p: () -> Unit) {
p()
a(p)
}
inline fun c(p: () -> Unit) {
p()
}
+3
View File
@@ -0,0 +1,3 @@
ERROR: compiler/testData/cli/js/inlineCycle.kt: (2, 5) The 'b' invocation is a part of inline cycle
ERROR: compiler/testData/cli/js/inlineCycle.kt: (15, 5) The 'a' invocation is a part of inline cycle
COMPILATION_ERROR
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/inlineCycle.kt
-d
$TEMP_DIR$
+20
View File
@@ -0,0 +1,20 @@
inline fun a(l: () -> Unit) {
b(l)
//check taht nested not recognized as cycle
c {
c {
}
}
}
inline fun b(p: () -> Unit) {
p()
a(p)
}
inline fun c(p: () -> Unit) {
p()
}
@@ -0,0 +1,3 @@
ERROR: compiler/testData/cli/jvm/inlineCycle.kt: (2, 5) The 'b' invocation is a part of inline cycle
ERROR: compiler/testData/cli/jvm/inlineCycle.kt: (15, 5) The 'a' invocation is a part of inline cycle
COMPILATION_ERROR