FIR HL API: Unwrap substitution overrides if it contains stub types

This commit is contained in:
Simon Ogorodnik
2021-12-02 02:32:55 +03:00
committed by teamcity
parent 9e8727e6a8
commit d084cfb65b
2 changed files with 5 additions and 2 deletions
@@ -221,6 +221,9 @@ internal class KtSymbolByFirBuilder private constructor(
fir.unwrapSubstitutionOverrideIfNeeded()?.let {
return buildFunctionSymbol(it)
}
if (fir.dispatchReceiverType?.contains { it is ConeStubType } == true) {
return buildFunctionSymbol(fir.originalIfFakeOverride() ?: error("Stub type in real declaration"))
}
check(fir.origin != FirDeclarationOrigin.SamConstructor)
return symbolsCache.cache(fir) { KtFirFunctionSymbol(fir, resolveState, token, this@KtSymbolByFirBuilder) }
@@ -1,3 +1,3 @@
Resolved to:
0: (in kotlin.properties.ReadWriteProperty) operator fun getValue(thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.Int
1: (in kotlin.properties.ReadWriteProperty) operator fun setValue(thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.Int)
0: (in kotlin.properties.ReadWriteProperty) operator fun getValue(thisRef: T, property: kotlin.reflect.KProperty<*>): V
1: (in kotlin.properties.ReadWriteProperty) operator fun setValue(thisRef: T, property: kotlin.reflect.KProperty<*>, value: V)