JS: prohibit external functions and accessors with bodies other than noImpl. Prohibit to use anything except noImpl for default parameters initializers in external functions. See KT-13892
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
external fun foo(): Int = noImpl
|
||||
|
||||
external fun bar(): Unit {
|
||||
noImpl
|
||||
}
|
||||
|
||||
external fun baz(): Int = <!WRONG_BODY_OF_EXTERNAL_DECLARATION!>23<!>
|
||||
|
||||
external fun f(x: Int, y: String = noImpl): Unit
|
||||
|
||||
external fun g(x: Int, y: String = <!WRONG_BODY_OF_EXTERNAL_DECLARATION!>""<!>): Unit
|
||||
|
||||
external var a: Int
|
||||
get() = noImpl
|
||||
set(value) {
|
||||
noImpl
|
||||
}
|
||||
|
||||
external val b: Int
|
||||
get() = <!WRONG_BODY_OF_EXTERNAL_DECLARATION!>23<!>
|
||||
|
||||
external val c: Int = noImpl
|
||||
|
||||
external val d: Int = <!WRONG_BODY_OF_EXTERNAL_DECLARATION!>23<!>
|
||||
|
||||
external class C {
|
||||
fun foo(): Int = noImpl
|
||||
|
||||
fun bar(): Int = <!WRONG_BODY_OF_EXTERNAL_DECLARATION!>23<!>
|
||||
}
|
||||
Reference in New Issue
Block a user