[FIR] Fix inconsistent RETURN_TYPE_MISMATCH and TYPE_MISMATCH reporting on functions and properties
^KT-51203 Fixed
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ fun foo(): String? {
|
||||
run {
|
||||
if (true) return@run
|
||||
|
||||
if (true) return <!RETURN_TYPE_MISMATCH, TYPE_MISMATCH!>Obj()<!> // correct error, type check against return type of function "foo"
|
||||
if (true) return <!RETURN_TYPE_MISMATCH!>Obj()<!> // correct error, type check against return type of function "foo"
|
||||
}
|
||||
|
||||
run {
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ val a: () -> Unit = l@{
|
||||
|
||||
val b: () -> Unit = l@{
|
||||
// Error, coercion can't be applied at this position!
|
||||
if (true) return@l "hello"
|
||||
if (true) return@l <!RETURN_TYPE_MISMATCH!>"hello"<!>
|
||||
|
||||
// However, this is OK, because here coercion is applied
|
||||
"hello"
|
||||
|
||||
Reference in New Issue
Block a user