Test for KT-2529 Support importing enum members using wildcard
#KT-2529 Fixed
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
// FILE: enum.kt
|
||||||
|
|
||||||
|
package enum
|
||||||
|
|
||||||
|
enum class HappyEnum {
|
||||||
|
CASE1
|
||||||
|
CASE2
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: user.kt
|
||||||
|
|
||||||
|
import enum.HappyEnum
|
||||||
|
import enum.HappyEnum.*
|
||||||
|
|
||||||
|
fun f(e: HappyEnum) {
|
||||||
|
when (e) {
|
||||||
|
CASE1 -> throw UnsupportedOperationException() // unresolved reference
|
||||||
|
CASE2 -> throw UnsupportedOperationException() // unresolved references
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1220,6 +1220,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
|||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.checkers.AbstractDiagnosticsTestWithEagerResolve", new File("compiler/testData/diagnostics/tests/enum"), "kt", false);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.checkers.AbstractDiagnosticsTestWithEagerResolve", new File("compiler/testData/diagnostics/tests/enum"), "kt", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumStarImport.kt")
|
||||||
|
public void testEnumStarImport() throws Exception {
|
||||||
|
doTest("compiler/testData/diagnostics/tests/enum/enumStarImport.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("importEnumFromJava.kt")
|
@TestMetadata("importEnumFromJava.kt")
|
||||||
public void testImportEnumFromJava() throws Exception {
|
public void testImportEnumFromJava() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/enum/importEnumFromJava.kt");
|
doTest("compiler/testData/diagnostics/tests/enum/importEnumFromJava.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user