KT-1892: initializers for extension properties

This commit is contained in:
Alex Tkachman
2012-08-04 22:07:21 +03:00
parent 186807a6d7
commit 4e0e7fb943
3 changed files with 16 additions and 10 deletions
@@ -0,0 +1,5 @@
val Int.ext : () -> Int = { 5 }
val Long.ext : Long = 4.ext().toLong() //(c.kt:4)
val y : Long = 10.toLong().ext
fun box() : String = if (y == 5.toLong()) "OK" else "fail"