[FE 1.0] Check callable reference return type safety during resolution

^KT-51844
^KT-52503 Fixed
This commit is contained in:
Victor Petukhov
2022-05-25 11:00:51 +02:00
committed by teamcity
parent 51551998c7
commit 0199c76c06
20 changed files with 140 additions and 33 deletions
@@ -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"
}