FIR: Fix type alias case for callable reference resolution type

This commit is contained in:
Denis.Zharkov
2021-10-26 17:57:14 +03:00
committed by TeamCityServer
parent a29dfb3b48
commit 37b5237e97
6 changed files with 43 additions and 3 deletions
@@ -32926,6 +32926,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt");
}
@Test
@TestMetadata("pairReference.kt")
public void testPairReference() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/pairReference.kt");
}
@Test
@TestMetadata("PropertyDelegateWithPrivateSet.kt")
public void testPropertyDelegateWithPrivateSet() throws Exception {
@@ -32926,6 +32926,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt");
}
@Test
@TestMetadata("pairReference.kt")
public void testPairReference() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/pairReference.kt");
}
@Test
@TestMetadata("PropertyDelegateWithPrivateSet.kt")
public void testPropertyDelegateWithPrivateSet() throws Exception {
@@ -32926,6 +32926,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
runTest("compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt");
}
@Test
@TestMetadata("pairReference.kt")
public void testPairReference() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/pairReference.kt");
}
@Test
@TestMetadata("PropertyDelegateWithPrivateSet.kt")
public void testPropertyDelegateWithPrivateSet() throws Exception {
@@ -144,12 +144,12 @@ class FirDoubleColonExpressionResolver(private val session: FirSession) {
val resolvedExpression = expression as? FirResolvedQualifier
?: return null
val firClass = resolvedExpression.expandedRegularClassIfAny()
val firClassLikeDeclaration = resolvedExpression.symbol?.fir
?: return null
val type = ConeClassLikeTypeImpl(
firClass.symbol.toLookupTag(),
Array(firClass.typeParameters.size) { index ->
firClassLikeDeclaration.symbol.toLookupTag(),
Array(firClassLikeDeclaration.typeParameters.size) { index ->
val typeArgument = expression.typeArguments.getOrNull(index)
if (typeArgument == null) ConeStarProjection
else when (typeArgument) {
@@ -0,0 +1,16 @@
// FIR_IDENTICAL
// SKIP_TXT
typealias MPair<K> = Pair<K, Int>
typealias TextWithOffset = MPair<String>
fun foo(c: Collection<TextWithOffset>) {
val a1 = c.map(TextWithOffset::first)
a1[0].length
val a2 = c.map(MPair<String>::first)
a2[0].length
val a3 = c.map(Pair<String, Int>::first)
a3[0].length
}
@@ -33022,6 +33022,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt");
}
@Test
@TestMetadata("pairReference.kt")
public void testPairReference() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/pairReference.kt");
}
@Test
@TestMetadata("PropertyDelegateWithPrivateSet.kt")
public void testPropertyDelegateWithPrivateSet() throws Exception {