Solve the constraint system for alpha-converted variables,

store initial and backward conversions for
substituting new constraints and the result
This commit is contained in:
Svetlana Isakova
2015-07-01 21:34:50 +03:00
parent a714de783f
commit f25f59bb6e
9 changed files with 80 additions and 61 deletions
@@ -15,6 +15,6 @@ class C<X, Z, Y : X>
class D<X, Z, Y : X>(<!UNUSED_PARAMETER!>foo<!>: C<X, Z, Y>) {
fun test(a: C<Y, Y, Y>) {
val d: D<X, Y, Y> = <!TYPE_MISMATCH!>D(a)<!>
val d: D<X, Y, Y> = <!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>D<!>(a)
}
}
@@ -17,8 +17,8 @@ fun test(out: Out<Int>, i: In<Int>, inv: A<Int>) {
r checkType { _<Int>() }
// T? <: Int => error
doIn(<!TYPE_MISMATCH!>i<!>)
<!TYPE_INFERENCE_INCORPORATION_ERROR!>doIn<!>(<!TYPE_MISMATCH!>i<!>)
// T? >: Int => error
doA(<!TYPE_MISMATCH!>inv<!>)
<!TYPE_INFERENCE_INCORPORATION_ERROR!>doA<!>(<!TYPE_MISMATCH!>inv<!>)
}
@@ -12,6 +12,6 @@ import p.J.*
class Foo<T>: Sub<T> {
fun foo(): Super<T> {
return <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo<!>()
return Foo()
}
}