Extract and normalize member scope calculation

Basically it's wrong to use original types' member scope
as a worker for SubstitutionScope.
Member scope should always be determined by type constructor's default one
and substitution/arguments

 #KT-10448 Fixed
This commit is contained in:
Denis Zharkov
2015-12-22 12:34:40 +03:00
parent 58caff3411
commit 365ff593f3
7 changed files with 71 additions and 63 deletions
@@ -0,0 +1,11 @@
// !CHECK_TYPE
class A<T> {
fun foo(): T = null!!
}
fun <E> A<E>.bar(): A<in E> = this
fun baz(x: A<out CharSequence>) {
x.bar().foo() checkType { _<Any?>() } // See KT-10448
}
@@ -0,0 +1,12 @@
package
public fun baz(/*0*/ x: A<out kotlin.CharSequence>): kotlin.Unit
public fun </*0*/ E> A<E>.bar(): A<in E>
public final class A</*0*/ T> {
public constructor A</*0*/ T>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): T
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}