J2K: converting of enum constants overriding members

This commit is contained in:
Valentin Kipyatkov
2015-05-27 14:45:47 +03:00
parent bb0b3fcd0c
commit 0a2983d602
14 changed files with 115 additions and 20 deletions
@@ -0,0 +1,11 @@
public enum E {
A,
B {
@Override
void bar() {
}
};
void bar(){}
}
@@ -0,0 +1,11 @@
public enum class E {
A,
B {
override fun bar() {
}
};
open fun bar() {
}
}
@@ -0,0 +1,24 @@
public enum E {
A(1) {
@Override
void bar() {
foo(this.p);
}
},
B(2) {
@Override
void bar() {
}
};
private int p;
E(int p) {
this.p = p;
}
void foo(int p) {}
abstract void bar();
}
@@ -0,0 +1,18 @@
// ERROR: Cannot access 'p': it is 'invisible_fake' in 'A'
public enum class E(private val p: Int) {
A(1) {
override fun bar() {
foo(this.p)
}
},
B(2) {
override fun bar() {
}
};
fun foo(p: Int) {
}
abstract fun bar()
}