Fix implicit type arguments resolution for inner classes

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
This commit is contained in:
Denis Zharkov
2016-09-13 16:04:17 +03:00
parent 15c0901a72
commit 7ca84649d7
25 changed files with 686 additions and 57 deletions
@@ -0,0 +1,18 @@
// !CHECK_TYPE
open class Outer<E> {
inner open class Inner<F> {
inner class Inner2<D> {
}
}
}
class DerivedOuter : Outer<String>() {
inner class DerivedInner : Inner<Int>() {
fun foo(): Inner2<Char> = null!!
}
}
fun foo() {
DerivedOuter().DerivedInner().foo() checkType { _<Outer<String>.Inner<Int>.Inner2<Char>>() }
}