type inference errors improvement
if constraint system without expected type was successful, expected type mismatch error should be generated (instead of conflicting substitutions error) #KT-731 fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package a
|
||||
|
||||
class A<T>(x: T) {
|
||||
val p = x
|
||||
}
|
||||
|
||||
fun <T, G> A<T>.foo(x: (T)-> G): G {
|
||||
return x(this.p)
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = A(1)
|
||||
val t: String = a.<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>foo<!>({p -> p})
|
||||
t : String
|
||||
}
|
||||
Reference in New Issue
Block a user