Codegen for "componentN" functions for data classes

This commit is contained in:
Alexander Udalov
2012-08-28 21:53:01 +04:00
parent b93db69a24
commit 2c84389a45
13 changed files with 268 additions and 0 deletions
@@ -0,0 +1,12 @@
data class A<T>(val x: T)
fun box(): String {
val a = A(42)
if (a.component1() != 42) return "Fail a: ${a.component1()}"
val b = A(239.toLong())
if (b.component1() != 239.toLong()) return "Fail b: ${b.component1()}"
val c = A("OK")
return c.component1()
}