Added test on function overriding return type with Unit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// overriden function returns Unit
|
||||
open class A {
|
||||
open fun foo(): Any = 42
|
||||
}
|
||||
|
||||
open class B: A() {
|
||||
override fun foo(): Unit { }
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a: A = B()
|
||||
println(a.foo())
|
||||
}
|
||||
Reference in New Issue
Block a user