KT-9461: Inference failed: type parameter fixed early

#KT-9461 Fixed
This commit is contained in:
Stanislav Erokhin
2015-10-05 17:11:15 +03:00
parent 493108eca1
commit b69197962d
4 changed files with 54 additions and 1 deletions
@@ -0,0 +1,17 @@
interface In<in I>
interface B : In<B>
interface C<I, T>
fun <I, T> In<I>.foo(<!UNUSED_PARAMETER!>f<!>: () -> C<I, T>) {}
fun <I, T, Self: In<I>> Self.foo2(<!UNUSED_PARAMETER!>f<!>: () -> C<I, T>) {}
class E : B // e <: In<B> <: In<E>
fun test(c: C<E, Int>, e: E) {
e.foo<E, Int> { c }
e.foo { c } // error here: expected C<B, ???> but must be C<??? : B, ???>
e.foo2 { c }
e.foo2 ({ c })
}