A couple of new tests

for boxing
    and for body assignment in an interface
This commit is contained in:
Alexander Gorshenev
2016-11-22 13:52:24 +03:00
committed by alexander-gorshenev
parent 2a0d01191a
commit 268e3b26c0
3 changed files with 40 additions and 0 deletions
+13
View File
@@ -397,3 +397,16 @@ task throw0(type: RunKonanTest) {
goldValue = "Done\n"
source = "runtime/basic/throw0.kt"
}
/*
task boxing0(type: RunKonanTest) {
goldValue = "17\n"
source = "runtime/basic/boxing0.kt"
}
*/
/*
task interface0(type: RunKonanTest) {
goldValue = "PASS\n"
source = "runtime/basic/interface0.kt"
}
*/
@@ -0,0 +1,10 @@
class Box<T>(t: T) {
var value = t
}
fun main(args: Array<String>) {
val box: Box<Int> = Box<Int>(17)
println(box.value)
}
@@ -0,0 +1,17 @@
interface A {
fun b() = c()
fun c()
}
class B(): A {
override fun c() {
println("PASSED")
}
}
fun main(args: Array<String>) {
val a:A = B()
a.b()
}