Report error on indirect inline cycles
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
$TESTDATA_DIR$/inlineCycle.kt
|
||||
-output
|
||||
$TEMP_DIR$
|
||||
@@ -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/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$
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user