[FIR] KT-58523: Ensure the compiler resolves to the typealias

This commit is contained in:
Nikolay Lunyak
2023-05-10 14:58:36 +03:00
committed by Space Team
parent 1b9ed568bb
commit 99ff36c77a
7 changed files with 66 additions and 0 deletions
@@ -909,6 +909,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/ReserveYieldNoMore2.kt");
}
@Test
@TestMetadata("resolutionToTypealiasInsteadOfProperty.kt")
public void testResolutionToTypealiasInsteadOfProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolutionToTypealiasInsteadOfProperty.kt");
}
@Test
@TestMetadata("ResolveOfJavaGenerics.kt")
public void testResolveOfJavaGenerics() throws Exception {
@@ -909,6 +909,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/ReserveYieldNoMore2.kt");
}
@Test
@TestMetadata("resolutionToTypealiasInsteadOfProperty.kt")
public void testResolutionToTypealiasInsteadOfProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolutionToTypealiasInsteadOfProperty.kt");
}
@Test
@TestMetadata("ResolveOfJavaGenerics.kt")
public void testResolveOfJavaGenerics() throws Exception {
@@ -909,6 +909,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/ReserveYieldNoMore2.kt");
}
@Test
@TestMetadata("resolutionToTypealiasInsteadOfProperty.kt")
public void testResolutionToTypealiasInsteadOfProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolutionToTypealiasInsteadOfProperty.kt");
}
@Test
@TestMetadata("ResolveOfJavaGenerics.kt")
public void testResolveOfJavaGenerics() throws Exception {
@@ -909,6 +909,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/ReserveYieldNoMore2.kt");
}
@Test
@TestMetadata("resolutionToTypealiasInsteadOfProperty.kt")
public void testResolutionToTypealiasInsteadOfProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolutionToTypealiasInsteadOfProperty.kt");
}
@Test
@TestMetadata("ResolveOfJavaGenerics.kt")
public void testResolveOfJavaGenerics() throws Exception {
@@ -0,0 +1,18 @@
// ISSUE: KT-58523
// FILE: pkg.kt
package pkg
class Klass
typealias ItemKey = Klass
// FILE: main.kt
import pkg.ItemKey
val ItemKey = 42
fun main() {
<!NO_COMPANION_OBJECT!>ItemKey<!> // K1: ok, K2: NO_COMPANION_OBJECT
}
@@ -0,0 +1,18 @@
// ISSUE: KT-58523
// FILE: pkg.kt
package pkg
class Klass
typealias ItemKey = Klass
// FILE: main.kt
import pkg.ItemKey
val ItemKey = 42
fun main() {
ItemKey // K1: ok, K2: NO_COMPANION_OBJECT
}
@@ -909,6 +909,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/ReserveYieldNoMore2.kt");
}
@Test
@TestMetadata("resolutionToTypealiasInsteadOfProperty.kt")
public void testResolutionToTypealiasInsteadOfProperty() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolutionToTypealiasInsteadOfProperty.kt");
}
@Test
@TestMetadata("ResolveOfJavaGenerics.kt")
public void testResolveOfJavaGenerics() throws Exception {