Introduce FirFunctionReturnTypeMismatchChecker
This commit is contained in:
@@ -11,7 +11,7 @@ interface KtLightMethod : PsiElement
|
||||
// With covariant array here we do not visit lambda (it.usage is KtLightMethod) below
|
||||
// Problem disappears if 'out' is removed
|
||||
fun <T> Array<out T>.filterNot(f: (T) -> Boolean): List<T> {
|
||||
return this
|
||||
return <!RETURN_TYPE_MISMATCH!>this<!>
|
||||
}
|
||||
|
||||
fun <T> Array<T>.toList(): List<T>? = null
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ open class J() : S() {
|
||||
}
|
||||
|
||||
open class Base<T : X, Z : T> {
|
||||
open fun kek(): Z = Z()
|
||||
open fun kek(): Z = <!RETURN_TYPE_MISMATCH!>Z()<!>
|
||||
}
|
||||
|
||||
open class GoodDerrived : Base<Y, W>() {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
|
||||
class Bar {
|
||||
operator fun invoke(): Foo { return this } // (1)
|
||||
operator fun invoke(): Foo { return <!RETURN_TYPE_MISMATCH!>this<!> } // (1)
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ fun x() {
|
||||
class Foo {
|
||||
|
||||
|
||||
operator fun Bar.invoke(): Foo { return this } // (2)
|
||||
operator fun Bar.invoke(): Foo { return <!RETURN_TYPE_MISMATCH!>this<!> } // (2)
|
||||
|
||||
val x: Bar = Bar()
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
class Bar {
|
||||
fun FooBar.invoke(): Bar = this
|
||||
fun FooBar.invoke(): Bar = <!RETURN_TYPE_MISMATCH!>this<!>
|
||||
}
|
||||
|
||||
class Buz
|
||||
|
||||
Reference in New Issue
Block a user