Default parameter values are not allowed in overriding functions

This commit is contained in:
Andrey Breslav
2012-04-25 20:38:28 +04:00
parent 577918a119
commit 3a56b7905d
5 changed files with 47 additions and 1 deletions
@@ -0,0 +1,15 @@
open class A {
open fun foo(a : Int) {}
}
class C : A() {
override fun foo(a : Int = <!DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE!>1<!>) {
super<A>.foo(a)
}
}
class D : A() {
override fun foo(b : Int = <!DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE!>1<!>) {
super<A>.foo(b)
}
}