7ca84649d7
When resolving arguments on inner classifier, one can omit the arguments for outer class 'Outer' if they are present implicitly in the scope: - One of the supertypes of current class is Outer - One of the outer classes or one of their supertypes is Outer Relevant arguments are obtained from the first type found by the algorithm above Note that before this commit implicit arguments were only been searched in containing classes #KT-11123 Fixed
19 lines
456 B
Kotlin
Vendored
19 lines
456 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
open class Outer<X, Y> {
|
|
inner class Inner<Z>
|
|
typealias Alias<W> = Map<W, X>
|
|
}
|
|
|
|
open class BaseDerived1<E, F> : Outer<F, E>()
|
|
open class BaseDerived2<X> : BaseDerived1<String, X>()
|
|
|
|
class Derived : BaseDerived2<Int>() {
|
|
fun foo(): Inner<Char> = null!!
|
|
fun baz(): Alias<Char> = null!!
|
|
}
|
|
|
|
fun foo() {
|
|
Derived().foo() checkType { _<Outer<Int, String>.Inner<Char>>() }
|
|
Derived().baz() checkType { _<Map<Char, Int>>() }
|
|
}
|