FE1.0/FIR: add test for "double import" situation
This commit is contained in:
+6
@@ -12820,6 +12820,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("DoubleImports.kt")
|
||||||
|
public void testDoubleImports() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/imports/DoubleImports.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||||
public void testExplicitImportsAmbiguity() throws Exception {
|
public void testExplicitImportsAmbiguity() throws Exception {
|
||||||
|
|||||||
+6
@@ -12820,6 +12820,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("DoubleImports.kt")
|
||||||
|
public void testDoubleImports() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/imports/DoubleImports.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||||
public void testExplicitImportsAmbiguity() throws Exception {
|
public void testExplicitImportsAmbiguity() throws Exception {
|
||||||
|
|||||||
+6
@@ -12820,6 +12820,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("DoubleImports.kt")
|
||||||
|
public void testDoubleImports() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/imports/DoubleImports.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||||
public void testExplicitImportsAmbiguity() throws Exception {
|
public void testExplicitImportsAmbiguity() throws Exception {
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// FILE: StarImported.kt
|
||||||
|
|
||||||
|
package star
|
||||||
|
|
||||||
|
class SomeClass
|
||||||
|
|
||||||
|
fun foo() {}
|
||||||
|
|
||||||
|
val bar = 1
|
||||||
|
|
||||||
|
// FILE: ExplicitImported.kt
|
||||||
|
|
||||||
|
package explicit
|
||||||
|
|
||||||
|
class AnotherClass
|
||||||
|
|
||||||
|
fun baz() {}
|
||||||
|
|
||||||
|
val gau = 2
|
||||||
|
|
||||||
|
// FILE: Test.kt
|
||||||
|
|
||||||
|
import star.*
|
||||||
|
import star.*
|
||||||
|
import explicit.<!CONFLICTING_IMPORT!>AnotherClass<!>
|
||||||
|
import explicit.<!CONFLICTING_IMPORT!>AnotherClass<!>
|
||||||
|
import explicit.baz
|
||||||
|
import explicit.baz
|
||||||
|
import explicit.gau
|
||||||
|
import explicit.gau
|
||||||
|
|
||||||
|
fun useSomeClass(): SomeClass = <!RESOLUTION_TO_CLASSIFIER!>SomeClass<!>()
|
||||||
|
|
||||||
|
fun useAnotherClass(): AnotherClass = <!RESOLUTION_TO_CLASSIFIER!>AnotherClass<!>()
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
foo()
|
||||||
|
baz()
|
||||||
|
val x = bar
|
||||||
|
val y = gau
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// FILE: StarImported.kt
|
||||||
|
|
||||||
|
package star
|
||||||
|
|
||||||
|
class SomeClass
|
||||||
|
|
||||||
|
fun foo() {}
|
||||||
|
|
||||||
|
val bar = 1
|
||||||
|
|
||||||
|
// FILE: ExplicitImported.kt
|
||||||
|
|
||||||
|
package explicit
|
||||||
|
|
||||||
|
class AnotherClass
|
||||||
|
|
||||||
|
fun baz() {}
|
||||||
|
|
||||||
|
val gau = 2
|
||||||
|
|
||||||
|
// FILE: Test.kt
|
||||||
|
|
||||||
|
import star.*
|
||||||
|
import star.*
|
||||||
|
import explicit.<!CONFLICTING_IMPORT!>AnotherClass<!>
|
||||||
|
import explicit.<!CONFLICTING_IMPORT!>AnotherClass<!>
|
||||||
|
import explicit.baz
|
||||||
|
import explicit.baz
|
||||||
|
import explicit.gau
|
||||||
|
import explicit.gau
|
||||||
|
|
||||||
|
fun useSomeClass(): SomeClass = SomeClass()
|
||||||
|
|
||||||
|
fun useAnotherClass(): AnotherClass = AnotherClass()
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
foo()
|
||||||
|
baz()
|
||||||
|
val x = bar
|
||||||
|
val y = gau
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun test(): kotlin.Unit
|
||||||
|
public fun useAnotherClass(): explicit.AnotherClass
|
||||||
|
public fun useSomeClass(): star.SomeClass
|
||||||
|
|
||||||
|
package explicit {
|
||||||
|
public val gau: kotlin.Int = 2
|
||||||
|
public fun baz(): kotlin.Unit
|
||||||
|
|
||||||
|
public final class AnotherClass {
|
||||||
|
public constructor AnotherClass()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
package star {
|
||||||
|
public val bar: kotlin.Int = 1
|
||||||
|
public fun foo(): kotlin.Unit
|
||||||
|
|
||||||
|
public final class SomeClass {
|
||||||
|
public constructor SomeClass()
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -12826,6 +12826,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
runTest("compiler/testData/diagnostics/tests/imports/DefaultImportsPriority.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("DoubleImports.kt")
|
||||||
|
public void testDoubleImports() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/imports/DoubleImports.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||||
public void testExplicitImportsAmbiguity() throws Exception {
|
public void testExplicitImportsAmbiguity() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user