Fix type checking of local return inside return expression

#KT-16426 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-04-07 16:37:35 +03:00
parent 7f287a4230
commit c9b468581a
9 changed files with 106 additions and 23 deletions
@@ -0,0 +1,20 @@
interface ClassData
fun f() = object : ClassData {
val someInt: Int
get() {
return 5
}
}
fun g() = object : ClassData {
init {
if (true) {
<!RETURN_NOT_ALLOWED, RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> 0
}
}
fun some(): Int {
return 6
}
}
@@ -0,0 +1,10 @@
package
public fun f(): ClassData
public fun g(): ClassData
public interface ClassData {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}