Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)

#KT-13340 Fixed
This commit is contained in:
Nikolay Krasko
2016-08-04 13:29:44 +03:00
parent 95ea191442
commit 300e0acd27
21 changed files with 70 additions and 32 deletions
@@ -17,7 +17,7 @@ inline fun inlineFun(s: ()->Int) {
fun noInlineCall(): String {
noInline {
if (true) {
<!RETURN_NOT_ALLOWED!>return@noInlineCall ""<!>
<!RETURN_NOT_ALLOWED!>return@noInlineCall<!> ""
}
1
}
@@ -1,6 +1,6 @@
fun box() : String {
test {
<!RETURN_NOT_ALLOWED!>return@box "123"<!>
<!RETURN_NOT_ALLOWED!>return@box<!> "123"
}
return "OK"
@@ -1,6 +1,6 @@
fun box() : String {
test {
<!RETURN_NOT_ALLOWED!>return@box "123"<!>
<!RETURN_NOT_ALLOWED!>return@box<!> "123"
}
return "OK"
@@ -7,7 +7,7 @@ inline fun <R> doCallInt(p: () -> R): R {
}
class A {
var result: Int = doCallInt { <!RETURN_NOT_ALLOWED!>return this<!> };
var result: Int = doCallInt { <!RETURN_NOT_ALLOWED!>return<!> this };
var field: Int
get() {