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:
+11
@@ -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
|
||||
}
|
||||
+12
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user