[FE 1.0] Take care callable reference candidates with recursive candidate return type

^KT-51844 Fixed
This commit is contained in:
Victor Petukhov
2022-04-17 11:35:28 +03:00
committed by teamcity
parent ec6ec20728
commit 9f31f074da
34 changed files with 218 additions and 55 deletions
@@ -0,0 +1,11 @@
// WITH_STDLIB
abstract class Foo {
}
// ERROR: Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
fun Foo.contains(vararg xs: Int) = xs.forEach(this::contains)
fun box(): String {
return "OK"
}
@@ -0,0 +1,11 @@
// WITH_STDLIB
abstract class Foo {
}
// ERROR: Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
fun Foo.contains(vararg xs: Int) = xs.forEach(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR, TYPE_MISMATCH!>this::<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>contains<!><!>)
fun box(): String {
return "OK"
}
@@ -0,0 +1,11 @@
package
public fun box(): kotlin.String
public fun Foo.contains(/*0*/ vararg xs: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public abstract class Foo {
public constructor Foo()
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
}