Test code generation for enum deriving from a trait
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun box() = MyEnum.E1.f() + MyEnum.E2.f()
|
||||||
|
|
||||||
|
enum class MyEnum : T {
|
||||||
|
E1 {
|
||||||
|
override fun f() = "O"
|
||||||
|
}
|
||||||
|
E2 {
|
||||||
|
override fun f() = "K"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trait T {
|
||||||
|
fun f(): String
|
||||||
|
}
|
||||||
@@ -2649,6 +2649,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumInheritedFromTrait.kt")
|
||||||
|
public void testEnumInheritedFromTrait() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/enumInheritedFromTrait.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("inPackage.kt")
|
@TestMetadata("inPackage.kt")
|
||||||
public void testInPackage() throws Exception {
|
public void testInPackage() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/inPackage.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/box/enum/inPackage.kt");
|
||||||
|
|||||||
@@ -38,4 +38,8 @@ public class EnumTest extends SingleFileTranslationTest {
|
|||||||
public void testAccessing() throws Exception {
|
public void testAccessing() throws Exception {
|
||||||
checkFooBoxIsOk();
|
checkFooBoxIsOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testEnumInheritedFromTrait() throws Exception {
|
||||||
|
checkFooBoxIsOk();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
fun box() = MyEnum.E1.f() + MyEnum.E2.f()
|
||||||
|
|
||||||
|
enum class MyEnum : T {
|
||||||
|
E1 {
|
||||||
|
override fun f() = "O"
|
||||||
|
}
|
||||||
|
E2 {
|
||||||
|
override fun f() = "K"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trait T {
|
||||||
|
fun f(): String
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user