FIR: Fix incorrect qualifier resolution in case of type parameters
^KT-51265 Fixed
This commit is contained in:
+6
@@ -40839,6 +40839,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51265.kt")
|
||||||
|
public void testKt51265() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/regressions/kt51265.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt528.kt")
|
@TestMetadata("kt528.kt")
|
||||||
public void testKt528() throws Exception {
|
public void testKt528() throws Exception {
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ class FirCallResolver(
|
|||||||
// A // should resolved to D.A
|
// A // should resolved to D.A
|
||||||
// A.B // should be resolved to A.B
|
// A.B // should be resolved to A.B
|
||||||
// }
|
// }
|
||||||
if (!result.applicability.isSuccess || (isUsedAsReceiver && result.candidates.all { it.symbol is FirClassifierSymbol })) {
|
if (!result.applicability.isSuccess || (isUsedAsReceiver && result.candidates.all { it.symbol is FirClassLikeSymbol })) {
|
||||||
components.resolveRootPartOfQualifier(
|
components.resolveRootPartOfQualifier(
|
||||||
callee, qualifiedAccess.source, qualifiedAccess.typeArguments, nonFatalDiagnosticFromExpression,
|
callee, qualifiedAccess.source, qualifiedAccess.typeArguments, nonFatalDiagnosticFromExpression,
|
||||||
)?.let { return it }
|
)?.let { return it }
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
// WITH_REFLECT
|
||||||
|
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
class OK
|
||||||
|
|
||||||
|
class T
|
||||||
|
|
||||||
|
inline fun <reified F : Any> bar(k: KClass<out F>): String = k.simpleName!!
|
||||||
|
inline fun <reified T : Any> foo(): String = bar(T::class)
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return foo<OK>()
|
||||||
|
}
|
||||||
+6
@@ -40377,6 +40377,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51265.kt")
|
||||||
|
public void testKt51265() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/regressions/kt51265.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt528.kt")
|
@TestMetadata("kt528.kt")
|
||||||
public void testKt528() throws Exception {
|
public void testKt528() throws Exception {
|
||||||
|
|||||||
+6
@@ -40839,6 +40839,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51265.kt")
|
||||||
|
public void testKt51265() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/regressions/kt51265.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt528.kt")
|
@TestMetadata("kt528.kt")
|
||||||
public void testKt528() throws Exception {
|
public void testKt528() throws Exception {
|
||||||
|
|||||||
+5
@@ -32475,6 +32475,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
runTest("compiler/testData/codegen/box/regressions/kt51171.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt51265.kt")
|
||||||
|
public void testKt51265() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/regressions/kt51265.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt528.kt")
|
@TestMetadata("kt528.kt")
|
||||||
public void testKt528() throws Exception {
|
public void testKt528() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/regressions/kt528.kt");
|
runTest("compiler/testData/codegen/box/regressions/kt528.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user