mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
Move properties of enum class object to the enum class
Similar to how it's done for usual classes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
String test() {
|
||||
String s;
|
||||
|
||||
s = Klass.NAME;
|
||||
if (!s.equals("Klass")) throw new AssertionError("Fail class: " + s);
|
||||
|
||||
s = Trait.NAME;
|
||||
if (!s.equals("Trait")) throw new AssertionError("Fail trait: " + s);
|
||||
|
||||
s = Enoom.NAME;
|
||||
if (!s.equals("Enoom")) throw new AssertionError("Fail enum: " + s);
|
||||
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user