[FE 1.0] Take care callable reference candidates with recursive candidate return type
^KT-51844 Fixed
This commit is contained in:
committed by
teamcity
parent
ec6ec20728
commit
9f31f074da
@@ -0,0 +1,15 @@
|
||||
// WITH_STDLIB
|
||||
|
||||
abstract class Foo {
|
||||
abstract fun contains(x: Int);
|
||||
}
|
||||
|
||||
// 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 {
|
||||
object : Foo() {
|
||||
override fun contains(x: Int) {}
|
||||
}.contains(1)
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM, JVM_IR, ANDROID, ANDROID_IR
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// WITH_STDLIB
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
Reference in New Issue
Block a user