No override check in FirClassUseSiteScope, fix nasty substitution bug
This fixes MPP override test (see mppFakeOverride in FirMultiModuleResolveTestGenerated)
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ class FirClassSubstitutionScope(
|
||||
}
|
||||
|
||||
private fun ConeKotlinType.substitute(): ConeKotlinType? {
|
||||
if (this is ConeTypeParameterType) return substitution[this]
|
||||
if (this is ConeTypeParameterType) return substitution[lookupTag]
|
||||
|
||||
val newArguments by lazy { arrayOfNulls<ConeKotlinTypeProjection>(typeArguments.size) }
|
||||
var initialized = false
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ class FirClassUseSiteScope(
|
||||
val self = (this as AbstractFirBasedSymbol<*>).fir as FirCallableMember
|
||||
val overriding = seen.firstOrNull {
|
||||
val member = (it as AbstractFirBasedSymbol<*>).fir as FirCallableMember
|
||||
member.isOverride && self.modality != Modality.FINAL
|
||||
self.modality != Modality.FINAL
|
||||
&& sameReceivers(member.receiverTypeRef, self.receiverTypeRef)
|
||||
&& similarFunctionsOrBothProperties(member, self)
|
||||
} // TODO: two or more overrides for one fun?
|
||||
|
||||
@@ -8,7 +8,7 @@ open class A {
|
||||
|
||||
class B : A() {
|
||||
override fun foo(): B = this
|
||||
fun bar(): B = this // Ambiguity, no override here
|
||||
fun bar(): B = this // Ambiguity, no override here (really it's just "missing override" and no ambiguity)
|
||||
override fun buz(p: B): B = this //No override as B <!:> A
|
||||
|
||||
fun test() {
|
||||
|
||||
@@ -32,7 +32,7 @@ FILE: simple.kt
|
||||
|
||||
public final function test(): R|kotlin/Unit| {
|
||||
R|/B.foo|()
|
||||
<Ambiguity: bar, [/B.bar, /A.bar]>#()
|
||||
R|/B.bar|()
|
||||
<Ambiguity: buz, [/B.buz, /A.buz]>#()
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ FILE: simpleFakeOverride.kt
|
||||
public constructor(): super<R|A<Some>|>()
|
||||
|
||||
public final function test(): R|kotlin/Unit| {
|
||||
R|FakeOverride</A.foo: R|T|>|(<Unresolved name: Some>#())
|
||||
R|FakeOverride</A.foo: R|Some|>|(<Unresolved name: Some>#())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user