[FIR] Fix inconsistent RETURN_TYPE_MISMATCH and TYPE_MISMATCH reporting on functions and properties
^KT-51203 Fixed
This commit is contained in:
@@ -11,14 +11,14 @@ abstract class Buggy {
|
||||
}
|
||||
|
||||
val anotherThree : Int
|
||||
get() = <!TYPE_MISMATCH!>coll.find{ it > 3 }<!> // does not work here
|
||||
get() = <!RETURN_TYPE_MISMATCH!>coll.find{ it > 3 }<!> // does not work here
|
||||
|
||||
val yetAnotherThree : Int
|
||||
get() = <!TYPE_MISMATCH!>coll.find({ v:Int -> v > 3 })<!> // neither here
|
||||
get() = <!RETURN_TYPE_MISMATCH!>coll.find({ v:Int -> v > 3 })<!> // neither here
|
||||
|
||||
val extendedGetter : Int
|
||||
get() {
|
||||
return <!TYPE_MISMATCH!>coll.find{ it > 3 }<!> // not even here!
|
||||
return <!RETURN_TYPE_MISMATCH!>coll.find{ it > 3 }<!> // not even here!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,18 +15,18 @@ class SomeClass {
|
||||
val e = E.VALUE
|
||||
|
||||
val withoutType: LambdaWithReceiver
|
||||
get() = when (e) {
|
||||
get() = <!RETURN_TYPE_MISMATCH!>when (e) {
|
||||
E.VALUE -> { param ->
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>method<!>(param)
|
||||
}
|
||||
}
|
||||
}<!>
|
||||
|
||||
val withExplicitType: LambdaWithReceiver
|
||||
get() = when (e) {
|
||||
get() = <!RETURN_TYPE_MISMATCH!>when (e) {
|
||||
E.VALUE -> { param: Parameter ->
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>method<!>(param)
|
||||
}
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
|
||||
class OtherClass {
|
||||
@@ -38,8 +38,8 @@ class OtherClass {
|
||||
|
||||
val e2 = E.VALUE
|
||||
val staticWithExplicitType: LambdaWithReceiver
|
||||
get() = when (e2) {
|
||||
get() = <!RETURN_TYPE_MISMATCH!>when (e2) {
|
||||
E.VALUE -> { param: Parameter ->
|
||||
<!UNRESOLVED_REFERENCE!>method<!>(param)
|
||||
}
|
||||
}
|
||||
}<!>
|
||||
|
||||
Reference in New Issue
Block a user