Files
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

21 lines
313 B
Kotlin
Vendored

// !CHECK_TYPE
//KT-731 Missing error from type inference
package a
import checkSubtype
class A<T>(x: T) {
val p = x
}
fun <T, G> A<T>.foo(x: (T)-> G): G {
return x(this.p)
}
fun main() {
val a = A(1)
val t: String = a.foo({p -> <!ARGUMENT_TYPE_MISMATCH!>p<!>})
checkSubtype<String>(t)
}