A couple of new tests
for boxing
and for body assignment in an interface
This commit is contained in:
committed by
alexander-gorshenev
parent
2a0d01191a
commit
268e3b26c0
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user