Added tests on interface calls of enum class

This commit is contained in:
Igor Chevdar
2017-02-22 14:37:42 +03:00
parent e664473f74
commit 9165d65560
3 changed files with 51 additions and 0 deletions
@@ -0,0 +1,19 @@
interface A {
fun foo(): String
}
enum class Zzz(val zzz: String, val x: Int) : A {
Z1("z1", 1),
Z2("z2", 2),
Z3("z3", 3);
override fun foo(): String{
return "('$zzz', $x)"
}
}
fun main(args: Array<String>) {
println(Zzz.Z3.foo())
val a: A = Zzz.Z3
println(a.foo())
}