Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt
T
Denis Zharkov 7ca84649d7 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
2016-09-15 10:33:19 +03:00

16 lines
298 B
Kotlin
Vendored

class A<T> {
fun foo() {
val q = object {
open inner class B
inner class C : B()
// No WRONG_NUMBER_OF_TYPE_ARGUMENTS should be reported on these types
val x: B = B()
val y: C = C()
}
q.x
q.y
}
}