Add more tests for KT-49200
- exotic situation 1 field + 2 entries - named import case - exotic situation 2 fields + 1 entry
This commit is contained in:
+18
@@ -12940,6 +12940,24 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity2.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity3.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity3() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity4.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity4() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity4.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||
public void testExplicitImportsAmbiguity() throws Exception {
|
||||
|
||||
+18
@@ -12940,6 +12940,24 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity2.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity3.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity3() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity4.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity4() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity4.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||
public void testExplicitImportsAmbiguity() throws Exception {
|
||||
|
||||
+18
@@ -12940,6 +12940,24 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity2.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity3.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity3() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity4.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity4() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity4.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||
public void testExplicitImportsAmbiguity() throws Exception {
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// KT-49200
|
||||
// FILE: first/KtNodeTypes.java
|
||||
|
||||
package first;
|
||||
|
||||
public interface KtNodeTypes {
|
||||
String SOME = "Some";
|
||||
}
|
||||
|
||||
// FILE: SomeEnum.kt
|
||||
|
||||
package second
|
||||
|
||||
enum class SomeEnum {
|
||||
SOME;
|
||||
}
|
||||
|
||||
// FILE: OtherEnum.kt
|
||||
|
||||
package third
|
||||
|
||||
enum class SomeEnum {
|
||||
SOME;
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
import first.KtNodeTypes.*
|
||||
import second.SomeEnum.*
|
||||
import third.SomeEnum.*
|
||||
|
||||
fun test(arg: String): Boolean {
|
||||
return when (arg) {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>SOME<!> -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// KT-49200
|
||||
// FILE: first/KtNodeTypes.java
|
||||
|
||||
package first;
|
||||
|
||||
public interface KtNodeTypes {
|
||||
String SOME = "Some";
|
||||
}
|
||||
|
||||
// FILE: SomeEnum.kt
|
||||
|
||||
package second
|
||||
|
||||
enum class SomeEnum {
|
||||
SOME;
|
||||
}
|
||||
|
||||
// FILE: OtherEnum.kt
|
||||
|
||||
package third
|
||||
|
||||
enum class SomeEnum {
|
||||
SOME;
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
import first.KtNodeTypes.*
|
||||
import second.SomeEnum.*
|
||||
import third.SomeEnum.*
|
||||
|
||||
fun test(arg: String): Boolean {
|
||||
return when (arg) {
|
||||
SOME -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ arg: kotlin.String): kotlin.Boolean
|
||||
|
||||
package first {
|
||||
|
||||
public interface KtNodeTypes {
|
||||
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
|
||||
|
||||
// Static members
|
||||
public const final val SOME: kotlin.String = "Some"
|
||||
}
|
||||
}
|
||||
|
||||
package second {
|
||||
|
||||
public final enum class SomeEnum : kotlin.Enum<second.SomeEnum> {
|
||||
enum entry SOME
|
||||
|
||||
private constructor SomeEnum()
|
||||
@kotlin.internal.IntrinsicConstEvaluation public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: second.SomeEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<second.SomeEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): second.SomeEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<second.SomeEnum>
|
||||
}
|
||||
}
|
||||
|
||||
package third {
|
||||
|
||||
public final enum class SomeEnum : kotlin.Enum<third.SomeEnum> {
|
||||
enum entry SOME
|
||||
|
||||
private constructor SomeEnum()
|
||||
@kotlin.internal.IntrinsicConstEvaluation public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: third.SomeEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<third.SomeEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): third.SomeEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<third.SomeEnum>
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
/test.kt:26:9: warning: ambiguous access to property 'first.KtNodeTypes.SOME' is deprecated because similar enum entry 'second.SomeEnum.SOME' is available. Please add explicit named import or use fully qualified name
|
||||
SOME -> true
|
||||
^
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// KT-49200
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
// FILE: first/KtNodeTypes.java
|
||||
|
||||
package first;
|
||||
|
||||
public interface KtNodeTypes {
|
||||
String SOME = "Some";
|
||||
}
|
||||
|
||||
// FILE: SomeEnum.kt
|
||||
|
||||
package second
|
||||
|
||||
enum class SomeEnum {
|
||||
SOME;
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
import first.KtNodeTypes.SOME
|
||||
import second.SomeEnum.SOME
|
||||
|
||||
fun test(arg: String): Boolean {
|
||||
return when (arg) {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>SOME<!> -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// KT-49200
|
||||
// !RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
// FILE: first/KtNodeTypes.java
|
||||
|
||||
package first;
|
||||
|
||||
public interface KtNodeTypes {
|
||||
String SOME = "Some";
|
||||
}
|
||||
|
||||
// FILE: SomeEnum.kt
|
||||
|
||||
package second
|
||||
|
||||
enum class SomeEnum {
|
||||
SOME;
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
import first.KtNodeTypes.SOME
|
||||
import second.SomeEnum.SOME
|
||||
|
||||
fun test(arg: String): Boolean {
|
||||
return when (arg) {
|
||||
<!DEPRECATED_RESOLVE_WITH_AMBIGUOUS_ENUM_ENTRY!>SOME<!> -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ arg: kotlin.String): kotlin.Boolean
|
||||
|
||||
package first {
|
||||
|
||||
public interface KtNodeTypes {
|
||||
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
|
||||
|
||||
// Static members
|
||||
public const final val SOME: kotlin.String = "Some"
|
||||
}
|
||||
}
|
||||
|
||||
package second {
|
||||
|
||||
public final enum class SomeEnum : kotlin.Enum<second.SomeEnum> {
|
||||
enum entry SOME
|
||||
|
||||
private constructor SomeEnum()
|
||||
@kotlin.internal.IntrinsicConstEvaluation public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: second.SomeEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<second.SomeEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): second.SomeEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<second.SomeEnum>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
// FIR_IDENTICAL
|
||||
// KT-49200
|
||||
// FILE: first/KtNodeTypes.java
|
||||
|
||||
package first;
|
||||
|
||||
public interface KtNodeTypes {
|
||||
String SOME = "Some";
|
||||
}
|
||||
|
||||
// FILE: SomeEnum.kt
|
||||
|
||||
package second
|
||||
|
||||
enum class SomeEnum {
|
||||
SOME;
|
||||
}
|
||||
|
||||
// FILE: third/OtherTypes.java
|
||||
|
||||
package third
|
||||
|
||||
public interface OtherTypes {
|
||||
String SOME = "Other";
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
import first.KtNodeTypes.*
|
||||
import second.SomeEnum.*
|
||||
import third.OtherTypes.*
|
||||
|
||||
fun test(arg: String): Boolean {
|
||||
return when (arg) {
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>SOME<!> -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ arg: kotlin.String): kotlin.Boolean
|
||||
|
||||
package first {
|
||||
|
||||
public interface KtNodeTypes {
|
||||
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
|
||||
|
||||
// Static members
|
||||
public const final val SOME: kotlin.String = "Some"
|
||||
}
|
||||
}
|
||||
|
||||
package second {
|
||||
|
||||
public final enum class SomeEnum : kotlin.Enum<second.SomeEnum> {
|
||||
enum entry SOME
|
||||
|
||||
private constructor SomeEnum()
|
||||
@kotlin.internal.IntrinsicConstEvaluation public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: second.SomeEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<second.SomeEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): second.SomeEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<second.SomeEnum>
|
||||
}
|
||||
}
|
||||
|
||||
package third {
|
||||
|
||||
public interface OtherTypes {
|
||||
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
|
||||
|
||||
// Static members
|
||||
public const final val SOME: kotlin.String = "Other"
|
||||
}
|
||||
}
|
||||
Generated
+18
@@ -12946,6 +12946,24 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity2.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity3.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity3() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("EnumEntryVsStaticAmbiguity4.kt")
|
||||
public void testEnumEntryVsStaticAmbiguity4() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity4.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExplicitImportsAmbiguity.kt")
|
||||
public void testExplicitImportsAmbiguity() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user