JVM_IR: Implement some BE diagnostics

TODO proper diagnostics tests with BE diagnostics
This commit is contained in:
Dmitry Petrov
2020-01-31 14:29:24 +03:00
parent c9df17f2f1
commit 8ef79f932c
14 changed files with 138 additions and 43 deletions
+6 -3
View File
@@ -1,14 +1,17 @@
inline fun a(l: () -> Unit) {
b(l)
inline fun a(q: () -> Unit) {
b(q)
//check that nested not recognized as cycle
// check that nested not recognized as cycle
c {
c {
}
}
withDefaults()
}
inline fun withDefaults(x: Int = 1) = x * 2
inline fun b(p: () -> Unit) {
p()
+2 -2
View File
@@ -1,7 +1,7 @@
compiler/testData/cli/jvm/inlineCycle.kt:2:5: error: the 'b' invocation is a part of inline cycle
b(l)
b(q)
^
compiler/testData/cli/jvm/inlineCycle.kt:15:5: error: the 'a' invocation is a part of inline cycle
compiler/testData/cli/jvm/inlineCycle.kt:18:5: error: the 'a' invocation is a part of inline cycle
a(p)
^
COMPILATION_ERROR
+4
View File
@@ -0,0 +1,4 @@
$TESTDATA_DIR$/inlineCycle.kt
-d
$TEMP_DIR$
-Xuse-ir
+7
View File
@@ -0,0 +1,7 @@
compiler/testData/cli/jvm/inlineCycle.kt:2:5: error: the 'b' invocation is a part of inline cycle
b(q)
^
compiler/testData/cli/jvm/inlineCycle.kt:18:5: error: the 'a' invocation is a part of inline cycle
a(p)
^
COMPILATION_ERROR
+5
View File
@@ -0,0 +1,5 @@
$TESTDATA_DIR$/nonLocalDisabled.kt
-Xno-inline
-d
$TEMP_DIR$
-Xuse-ir
+7
View File
@@ -0,0 +1,7 @@
compiler/testData/cli/jvm/nonLocalDisabled.kt:3:9: error: non-local returns are not allowed with inlining disabled
return
^
compiler/testData/cli/jvm/nonLocalDisabled.kt:7:9: error: non-local returns are not allowed with inlining disabled
return@a
^
COMPILATION_ERROR