[FIR] Fix JVM mapped function callable id

This commit is contained in:
Mikhail Glukhikh
2020-08-28 18:40:18 +03:00
parent db815c96c5
commit 5efabe063e
10 changed files with 92 additions and 5 deletions
@@ -1716,6 +1716,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
public void testFirBuilder() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/FirBuilder.kt");
}
@TestMetadata("putIfAbsent.kt")
public void testPutIfAbsent() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/putIfAbsent.kt");
}
}
@TestMetadata("compiler/testData/ir/irText/lambdas")
@@ -45,7 +45,7 @@ fun wrapScopeWithJvmMapped(
(klass.symbol.constructType(
klass.typeParameters.map { ConeTypeParameterTypeImpl(it.symbol.toLookupTag(), false) }.toTypedArray(),
false
) as ConeClassLikeType).wrapSubstitutionScopeIfNeed(useSiteSession, jvmMappedScope, klass, scopeSession)
) as ConeClassLikeType).wrapSubstitutionScopeIfNeed(useSiteSession, jvmMappedScope, klass, scopeSession, klass.classId)
}
}
} else {
@@ -88,7 +88,7 @@ fun ConeClassLikeType.wrapSubstitutionScopeIfNeed(
useSiteMemberScope: FirTypeScope,
declaration: FirClassLikeDeclaration<*>,
builder: ScopeSession,
derivedClassId: ClassId? = null
derivedClassId: ClassId?
): FirTypeScope {
if (this.typeArguments.isEmpty()) return useSiteMemberScope
return builder.getOrBuild(declaration.symbol, SubstitutionScopeKey(this)) {
@@ -45,7 +45,7 @@ class FirClassSubstitutionScope(
constructor(
session: FirSession, useSiteMemberScope: FirTypeScope, scopeSession: ScopeSession,
substitution: Map<FirTypeParameterSymbol, ConeKotlinType>,
skipPrivateMembers: Boolean, derivedClassId: ClassId? = null
skipPrivateMembers: Boolean, derivedClassId: ClassId?
) : this(session, useSiteMemberScope, scopeSession, substitutorByMap(substitution), skipPrivateMembers, derivedClassId)
override fun processFunctionsByName(name: Name, processor: (FirFunctionSymbol<*>) -> Unit) {