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:
Svetlana Isakova
2012-07-31 20:25:32 +04:00
parent 077f0084bd
commit 4e0a9f2af6
10 changed files with 97 additions and 43 deletions
@@ -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
}