From acb03cb28c9cc4e3e78486605b69ce8ff594f60e Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 15 Oct 2020 11:06:02 +0300 Subject: [PATCH] [FIR2IR] Expand type during super qualifier search --- .../kotlin/fir/backend/generators/CallAndReferenceGenerator.kt | 3 ++- compiler/testData/codegen/box/jdk/kt1397.kt | 1 - .../testData/codegen/box/specialBuiltins/explicitSuperCall.kt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index 6517319d7c4..73f63c70351 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.references.FirSuperReference import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.resolve.calls.getExpectedTypeForSAMConversion import org.jetbrains.kotlin.fir.resolve.calls.isFunctional +import org.jetbrains.kotlin.fir.resolve.fullyExpandedType import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope @@ -168,7 +169,7 @@ class CallAndReferenceGenerator( val superTypeRef = dispatchReceiverReference.superTypeRef val coneSuperType = superTypeRef.coneTypeSafe() if (coneSuperType != null) { - val firClassSymbol = coneSuperType.lookupTag.toSymbol(session) as? FirClassSymbol<*> + val firClassSymbol = coneSuperType.fullyExpandedType(session).lookupTag.toSymbol(session) as? FirClassSymbol<*> if (firClassSymbol != null) { return classifierStorage.getIrClassSymbol(firClassSymbol) } diff --git a/compiler/testData/codegen/box/jdk/kt1397.kt b/compiler/testData/codegen/box/jdk/kt1397.kt index d4cae003aa7..33116232260 100644 --- a/compiler/testData/codegen/box/jdk/kt1397.kt +++ b/compiler/testData/codegen/box/jdk/kt1397.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt index eb8cf9326cf..6c0a3b7f566 100644 --- a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt +++ b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE