JS: prohibit overriding external functions with optional parameters by non-external functions. See KT-13889

This commit is contained in:
Alexey Andreev
2016-12-12 17:43:47 +03:00
parent f3d001077b
commit e2dab5ab5c
8 changed files with 158 additions and 2 deletions
@@ -0,0 +1,32 @@
open external class A {
open fun f(x: Int = noImpl)
}
class B : A() {
<!OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS!>override fun f(x: Int)<!> {}
}
external class C : A() {
override fun f(x: Int) {}
}
external interface I {
fun f(x: Int = noImpl)
}
open external class D {
open fun f(x: Int)
}
class E : D() {
override fun f(x: Int) {}
}
class F : D(), I {
<!OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS!>override fun f(x: Int)<!> {}
}
external class G : D(), I {
override fun f(x: Int) {}
}