Minor, add test on bound reference to enum entry member

This commit is contained in:
Alexander Udalov
2016-07-21 19:56:23 +03:00
parent 9ab8da2ef9
commit 0dd71cc0c0
2 changed files with 19 additions and 0 deletions
@@ -0,0 +1,13 @@
enum class E {
A, B;
fun foo() = this.name
}
fun box(): String {
val f = E.A::foo
if (f() != "A") return "Fail 1: ${f()}"
if (f != E.B::foo) return "Fail 2"
return "OK"
}
@@ -1470,6 +1470,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("enumEntryMember.kt")
public void testEnumEntryMember() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/callableReference/bound/enumEntryMember.kt");
doTest(fileName);
}
@TestMetadata("kt12738.kt")
public void testKt12738() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/callableReference/bound/kt12738.kt");