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:
Vendored
+6
-6
@@ -2,26 +2,26 @@
|
||||
|
||||
external class A {
|
||||
@nativeInvoke
|
||||
fun foo() {}
|
||||
fun foo() {noImpl}
|
||||
|
||||
@nativeInvoke
|
||||
fun invoke(a: String): Int = 0
|
||||
fun invoke(a: String): Int = noImpl
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||
val foo = 0
|
||||
val foo: Int = noImpl
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||
object Obj1 {}
|
||||
|
||||
companion object {
|
||||
@nativeInvoke
|
||||
fun foo() {}
|
||||
fun foo() { noImpl }
|
||||
|
||||
@nativeInvoke
|
||||
fun invoke(a: String): Int = 0
|
||||
fun invoke(a: String): Int = noImpl
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||
val foo = 0
|
||||
val foo: Int = noImpl
|
||||
|
||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||
object Obj2 {}
|
||||
|
||||
Reference in New Issue
Block a user