FIR supertype resolve: decrease priority of type parameter scope
This commit is contained in:
+1
-1
@@ -43,12 +43,12 @@ abstract class FirAbstractTreeTransformerWithSuperTypes(
|
|||||||
.asReversed().mapTo(towerScope.scopes) {
|
.asReversed().mapTo(towerScope.scopes) {
|
||||||
nestedClassifierScope(it.lookupTag.classId, session)
|
nestedClassifierScope(it.lookupTag.classId, session)
|
||||||
}
|
}
|
||||||
|
regularClass.addTypeParametersScope()
|
||||||
val companionObjects = regularClass.declarations.filterIsInstance<FirRegularClass>().filter { it.isCompanion }
|
val companionObjects = regularClass.declarations.filterIsInstance<FirRegularClass>().filter { it.isCompanion }
|
||||||
for (companionObject in companionObjects) {
|
for (companionObject in companionObjects) {
|
||||||
towerScope.scopes += nestedClassifierScope(companionObject)
|
towerScope.scopes += nestedClassifierScope(companionObject)
|
||||||
}
|
}
|
||||||
towerScope.scopes += nestedClassifierScope(regularClass)
|
towerScope.scopes += nestedClassifierScope(regularClass)
|
||||||
regularClass.addTypeParametersScope()
|
|
||||||
|
|
||||||
transformElement(regularClass, data)
|
transformElement(regularClass, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ FILE: typeParameterVsNested.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract val x: R|T|
|
public abstract val x: R|test/My.T|
|
||||||
public get(): R|T|
|
public get(): R|test/My.T|
|
||||||
|
|
||||||
public abstract fun foo(arg: R|T|): R|kotlin/Unit|
|
public abstract fun foo(arg: R|test/My.T|): R|kotlin/Unit|
|
||||||
|
|
||||||
public abstract val y: R|test/My.T|
|
public abstract val y: R|test/My.T|
|
||||||
public get(): R|test/My.T|
|
public get(): R|test/My.T|
|
||||||
@@ -24,9 +24,9 @@ FILE: typeParameterVsNested.kt
|
|||||||
public abstract val z: R|test/My.T|
|
public abstract val z: R|test/My.T|
|
||||||
public get(): R|test/My.T|
|
public get(): R|test/My.T|
|
||||||
|
|
||||||
public final class Some : R|class error: Type parameter cannot be a super-type: T| {
|
public final class Some : R|test/My.T| {
|
||||||
public constructor(): R|test/My.Some| {
|
public constructor(): R|test/My.Some| {
|
||||||
super<R|T|>()
|
super<R|test/My.T|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user