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:
@@ -8,10 +8,10 @@ external class <!NESTED_JS_MODULE_PROHIBITED!>A<!>
|
|||||||
external <!NESTED_JS_MODULE_PROHIBITED!>object B<!>
|
external <!NESTED_JS_MODULE_PROHIBITED!>object B<!>
|
||||||
|
|
||||||
<!NESTED_JS_MODULE_PROHIBITED!>@JsModule("foo")
|
<!NESTED_JS_MODULE_PROHIBITED!>@JsModule("foo")
|
||||||
external fun foo()<!> = 23
|
external fun foo(): Int<!>
|
||||||
|
|
||||||
<!NESTED_JS_MODULE_PROHIBITED!>@JsModule("bar")
|
<!NESTED_JS_MODULE_PROHIBITED!>@JsModule("bar")
|
||||||
external val bar<!> = 42
|
external val bar: Int<!>
|
||||||
|
|
||||||
<!NESTED_JS_MODULE_PROHIBITED!>@JsNonModule
|
<!NESTED_JS_MODULE_PROHIBITED!>@JsNonModule
|
||||||
external val baz<!> = 99
|
external val baz: Int<!>
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package foo {
|
package foo {
|
||||||
@kotlin.js.JsModule(import = "bar") public external val bar: kotlin.Int = 42
|
@kotlin.js.JsModule(import = "bar") public external val bar: kotlin.Int
|
||||||
@kotlin.js.JsNonModule public external val baz: kotlin.Int = 99
|
@kotlin.js.JsNonModule public external val baz: kotlin.Int
|
||||||
@kotlin.js.JsModule(import = "foo") public external fun foo(): kotlin.Int
|
@kotlin.js.JsModule(import = "foo") public external fun foo(): kotlin.Int
|
||||||
|
|
||||||
@kotlin.js.JsModule(import = "A") public external final class A {
|
@kotlin.js.JsModule(import = "A") public external final class A {
|
||||||
|
|||||||
@@ -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<!>
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public external var a: kotlin.Int
|
||||||
|
public external val b: kotlin.Int
|
||||||
|
public external val c: kotlin.Int
|
||||||
|
public external val d: kotlin.Int = 23
|
||||||
|
public external fun bar(): kotlin.Unit
|
||||||
|
public external fun baz(): kotlin.Int
|
||||||
|
public external fun f(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String = ...): kotlin.Unit
|
||||||
|
public external fun foo(): kotlin.Int
|
||||||
|
public external fun g(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String = ...): kotlin.Unit
|
||||||
|
|
||||||
|
public external final class C {
|
||||||
|
public constructor C()
|
||||||
|
public final fun bar(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
public final fun foo(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
Vendored
+13
-13
@@ -2,36 +2,36 @@
|
|||||||
|
|
||||||
external class A {
|
external class A {
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun get(a: String): Any? = null
|
fun get(a: String): Any? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun take(a: Number): String? = null
|
fun take(a: Number): String? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun foo(a: Double): String? = null
|
fun foo(a: Double): String? = noImpl
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun get(a: String): Any? = null
|
fun get(a: String): Any? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun take(a: Number): String? = null
|
fun take(a: Number): String? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun foo(a: Double): String? = null
|
fun foo(a: Double): String? = noImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
external class B {
|
external class B {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
object Obj1 {}
|
object Obj1 {}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
object Obj2 {}
|
object Obj2 {}
|
||||||
@@ -40,18 +40,18 @@ external class B {
|
|||||||
|
|
||||||
external class C {
|
external class C {
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
||||||
fun get(): Any?<!> = null
|
fun get(): Any?<!> = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = null
|
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) {}
|
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) { noImpl }
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = 0
|
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: String = "foo"<!>): Int? = 0
|
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: String = noImpl<!>): Int? = noImpl
|
||||||
|
|
||||||
}
|
}
|
||||||
Vendored
+2
-2
@@ -22,14 +22,14 @@ public external final class A {
|
|||||||
|
|
||||||
public external final class B {
|
public external final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
@kotlin.js.nativeGetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeGetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
public companion object Companion {
|
public companion object Companion {
|
||||||
private constructor Companion()
|
private constructor Companion()
|
||||||
@kotlin.js.nativeGetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeGetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|||||||
+18
-35
@@ -4,36 +4,36 @@ external class A {
|
|||||||
class B {
|
class B {
|
||||||
class A {
|
class A {
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun get(a: String): Any? = null
|
fun get(a: String): Any? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun take(a: Number): String? = null
|
fun take(a: Number): String? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun foo(a: Double): String? = null
|
fun foo(a: Double): String? = noImpl
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun get(a: String): Any? = null
|
fun get(a: String): Any? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun take(a: Number): String? = null
|
fun take(a: Number): String? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun foo(a: Double): String? = null
|
fun foo(a: Double): String? = noImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class B {
|
class B {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
object Obj1 {}
|
object Obj1 {}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeGetter<!>
|
||||||
object Obj2 {}
|
object Obj2 {}
|
||||||
@@ -42,53 +42,36 @@ external class A {
|
|||||||
|
|
||||||
class C {
|
class C {
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
||||||
fun get(): Any?<!> = null
|
fun get(): Any?<!> = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = null
|
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) {}
|
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) { noImpl }
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = 0
|
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Number = 1.1<!>): Int? = 0
|
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Number = noImpl<!>): Int? = noImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
object obj {
|
object obj {
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
||||||
fun get(): Any?<!> = null
|
fun get(): Any?<!> = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = null
|
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) {}
|
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) { noImpl }
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = 0
|
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = noImpl
|
||||||
|
|
||||||
@nativeGetter
|
@nativeGetter
|
||||||
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: String = "foo"<!>): Int? = 0
|
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: String = noImpl<!>): Int? = noImpl
|
||||||
}
|
|
||||||
|
|
||||||
val anonymous = object {
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
|
||||||
fun get(): Any?<!> = null
|
|
||||||
|
|
||||||
@nativeGetter
|
|
||||||
fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any? = null
|
|
||||||
|
|
||||||
@nativeGetter
|
|
||||||
fun <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>foo<!>(a: Int) {}
|
|
||||||
|
|
||||||
@nativeGetter
|
|
||||||
fun bar(a: String): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Int<!> = 0
|
|
||||||
|
|
||||||
@nativeGetter
|
|
||||||
fun baz(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: String = "foo"<!>): Int? = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-3
@@ -8,7 +8,6 @@ public external final class A {
|
|||||||
|
|
||||||
public final class B {
|
public final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
public final val anonymous: kotlin.Any
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
@@ -35,14 +34,14 @@ public external final class A {
|
|||||||
|
|
||||||
public final class B {
|
public final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
@kotlin.js.nativeGetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeGetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
public companion object Companion {
|
public companion object Companion {
|
||||||
private constructor Companion()
|
private constructor Companion()
|
||||||
@kotlin.js.nativeGetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeGetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|||||||
Vendored
+6
-6
@@ -2,26 +2,26 @@
|
|||||||
|
|
||||||
external class A {
|
external class A {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun foo() {}
|
fun foo() {noImpl}
|
||||||
|
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun invoke(a: String): Int = 0
|
fun invoke(a: String): Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||||
object Obj1 {}
|
object Obj1 {}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun foo() {}
|
fun foo() { noImpl }
|
||||||
|
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun invoke(a: String): Int = 0
|
fun invoke(a: String): Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||||
object Obj2 {}
|
object Obj2 {}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
public external final class A {
|
public external final class A {
|
||||||
public constructor A()
|
public constructor A()
|
||||||
@kotlin.js.nativeInvoke public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeInvoke public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
@kotlin.js.nativeInvoke public final fun foo(): kotlin.Unit
|
@kotlin.js.nativeInvoke public final fun foo(): kotlin.Unit
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
@@ -11,7 +11,7 @@ public external final class A {
|
|||||||
|
|
||||||
public companion object Companion {
|
public companion object Companion {
|
||||||
private constructor Companion()
|
private constructor Companion()
|
||||||
@kotlin.js.nativeInvoke public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeInvoke public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
@kotlin.js.nativeInvoke public final fun foo(): kotlin.Unit
|
@kotlin.js.nativeInvoke public final fun foo(): kotlin.Unit
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
|||||||
+6
-14
@@ -4,34 +4,26 @@ external class A {
|
|||||||
class B {
|
class B {
|
||||||
class C {
|
class C {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun foo() {}
|
fun foo() { noImpl }
|
||||||
|
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun invoke(a: String): Int = 0
|
fun invoke(a: String): Int = noImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
object obj {
|
object obj {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun foo() {}
|
fun foo() { noImpl }
|
||||||
|
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun invoke(a: String): Int = 0
|
fun invoke(a: String): Int = noImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun foo() {}
|
fun foo() { noImpl }
|
||||||
|
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun invoke(a: String): Int = 0
|
fun invoke(a: String): Int = noImpl
|
||||||
}
|
|
||||||
|
|
||||||
val anonymous = object {
|
|
||||||
@nativeInvoke
|
|
||||||
fun foo() {}
|
|
||||||
|
|
||||||
@nativeInvoke
|
|
||||||
fun invoke(a: String): Int = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-1
@@ -8,7 +8,6 @@ public external final class A {
|
|||||||
|
|
||||||
public final class B {
|
public final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
public final val anonymous: kotlin.Any
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|||||||
Vendored
+18
-18
@@ -2,48 +2,48 @@
|
|||||||
|
|
||||||
external class A {
|
external class A {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set(a: String, v: Any?): Any? = null
|
fun set(a: String, v: Any?): Any? = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun put(a: Number, v: String) {}
|
fun put(a: Number, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun foo(a: Int, v: String) {}
|
fun foo(a: Int, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set4(a: Double, v: String): Any = 1
|
fun set4(a: Double, v: String): Any = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set5(a: Double, v: String): CharSequence = "OK"
|
fun set5(a: Double, v: String): CharSequence = noImpl
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set(a: String, v: Any?): Any? = null
|
fun set(a: String, v: Any?): Any? = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun put(a: Number, v: String) {}
|
fun put(a: Number, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun foo(a: Int, v: String) {}
|
fun foo(a: Int, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set4(a: Double, v: String): Any = 1
|
fun set4(a: Double, v: String): Any = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set5(a: Double, v: String): CharSequence = "OK"
|
fun set5(a: Double, v: String): CharSequence = noImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
external class B {
|
external class B {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
object Obj1 {}
|
object Obj1 {}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
object Obj2 {}
|
object Obj2 {}
|
||||||
@@ -52,20 +52,20 @@ external class B {
|
|||||||
|
|
||||||
external class C {
|
external class C {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set6(a: Double, v: String): <!NATIVE_SETTER_WRONG_RETURN_TYPE!>Number<!> = 1
|
fun set6(a: Double, v: String): <!NATIVE_SETTER_WRONG_RETURN_TYPE!>Number<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(): Any?<!> = null
|
fun set(): Any?<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = null
|
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(a: String, v: Any, v2: Any)<!> {}
|
fun set(a: String, v: Any, v2: Any)<!> { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun foo(a: Number, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "aa"<!>) = "OK"
|
fun foo(a: Number, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = noImpl<!>): String = noImpl
|
||||||
}
|
}
|
||||||
Vendored
+2
-2
@@ -26,14 +26,14 @@ public external final class A {
|
|||||||
|
|
||||||
public external final class B {
|
public external final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
@kotlin.js.nativeSetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeSetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
public companion object Companion {
|
public companion object Companion {
|
||||||
private constructor Companion()
|
private constructor Companion()
|
||||||
@kotlin.js.nativeSetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeSetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|||||||
+23
-40
@@ -4,48 +4,48 @@ external class A {
|
|||||||
class B {
|
class B {
|
||||||
class A {
|
class A {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set(a: String, v: Any?): Any? = null
|
fun set(a: String, v: Any?): Any? = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun put(a: Number, v: String) {}
|
fun put(a: Number, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun foo(a: Int, v: String) {}
|
fun foo(a: Int, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set4(a: Double, v: String): Any = 1
|
fun set4(a: Double, v: String): Any = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set5(a: Double, v: String): CharSequence = "OK"
|
fun set5(a: Double, v: String): CharSequence = noImpl
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set(a: String, v: Any?): Any? = null
|
fun set(a: String, v: Any?): Any? = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun put(a: Number, v: String) {}
|
fun put(a: Number, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun foo(a: Int, v: String) {}
|
fun foo(a: Int, v: String) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set4(a: Double, v: String): Any = 1
|
fun set4(a: Double, v: String): Any = noImpl
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set5(a: Double, v: String): CharSequence = "OK"
|
fun set5(a: Double, v: String): CharSequence = noImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class B {
|
class B {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
object Obj1 {}
|
object Obj1 {}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
val foo = 0
|
val foo: Int = noImpl
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
|
||||||
object Obj2 {}
|
object Obj2 {}
|
||||||
@@ -54,56 +54,39 @@ external class A {
|
|||||||
|
|
||||||
class C {
|
class C {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set6(a: Double, v: String): <!NATIVE_SETTER_WRONG_RETURN_TYPE!>Number<!> = 1
|
fun set6(a: Double, v: String): <!NATIVE_SETTER_WRONG_RETURN_TYPE!>Number<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(): Any?<!> = null
|
fun set(): Any?<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = null
|
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(a: String, v: Any, v2: Any)<!> {}
|
fun set(a: String, v: Any, v2: Any)<!> { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Double = 0.0<!>, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "str"<!>) = "OK"
|
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Double = noImpl<!>, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = noImpl<!>): String = noImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
object obj {
|
object obj {
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(): Any?<!> = null
|
fun set(): Any?<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = null
|
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = noImpl
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||||
fun set(a: String, v: Any, v2: Any)<!> {}
|
fun set(a: String, v: Any, v2: Any)<!> { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) { noImpl }
|
||||||
|
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun foo(a: Int, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "str"<!>) = "OK"
|
fun foo(a: Int, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = noImpl<!>): String = noImpl
|
||||||
}
|
|
||||||
|
|
||||||
val anonymous = object {
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
|
||||||
fun set(): Any?<!> = null
|
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = null
|
|
||||||
|
|
||||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
|
||||||
fun set(a: String, v: Any, v2: Any)<!> {}
|
|
||||||
|
|
||||||
@nativeSetter
|
|
||||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
|
||||||
|
|
||||||
@nativeSetter
|
|
||||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Number = 0.0<!>, v: String) = "OK"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-3
@@ -8,7 +8,6 @@ public external final class A {
|
|||||||
|
|
||||||
public final class B {
|
public final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
public final val anonymous: kotlin.Any
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
@@ -39,14 +38,14 @@ public external final class A {
|
|||||||
|
|
||||||
public final class B {
|
public final class B {
|
||||||
public constructor B()
|
public constructor B()
|
||||||
@kotlin.js.nativeSetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeSetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|
||||||
public companion object Companion {
|
public companion object Companion {
|
||||||
private constructor Companion()
|
private constructor Companion()
|
||||||
@kotlin.js.nativeSetter public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeSetter public final val foo: kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ external class TopLevelNative {
|
|||||||
|
|
||||||
class B
|
class B
|
||||||
|
|
||||||
fun foo() = 23
|
fun foo(): Int = noImpl
|
||||||
|
|
||||||
<!NESTED_EXTERNAL_DECLARATION!>external fun bar(): Int<!>
|
<!NESTED_EXTERNAL_DECLARATION!>external fun bar(): Int<!>
|
||||||
|
|
||||||
val x = "a"
|
val x: String = noImpl
|
||||||
|
|
||||||
<!NESTED_EXTERNAL_DECLARATION!>external val y: String<!>
|
<!NESTED_EXTERNAL_DECLARATION!>external val y: String<!>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public final class TopLevel {
|
|||||||
|
|
||||||
public external final class TopLevelNative {
|
public external final class TopLevelNative {
|
||||||
public constructor TopLevelNative()
|
public constructor TopLevelNative()
|
||||||
public final val x: kotlin.String = "a"
|
public final val x: kotlin.String
|
||||||
public external final val y: kotlin.String
|
public external final val y: kotlin.String
|
||||||
public final external fun bar(): kotlin.Int
|
public final external fun bar(): kotlin.Int
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@ external val baz: Int
|
|||||||
external val boo: Int = noImpl
|
external val boo: Int = noImpl
|
||||||
|
|
||||||
external fun foo()
|
external fun foo()
|
||||||
external fun bar() {}
|
external fun bar() { noImpl }
|
||||||
|
|
||||||
external interface T {
|
external interface T {
|
||||||
val baz: Int
|
val baz: Int
|
||||||
@@ -27,7 +27,7 @@ external class C {
|
|||||||
val boo: Int = noImpl
|
val boo: Int = noImpl
|
||||||
|
|
||||||
fun foo()
|
fun foo()
|
||||||
fun bar() {}
|
fun bar() { noImpl }
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val baz: Int
|
val baz: Int
|
||||||
|
|||||||
+1
-1
@@ -9,5 +9,5 @@ external object O {
|
|||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun foo()
|
fun foo()
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun bar() {}
|
fun bar() { noImpl }
|
||||||
}
|
}
|
||||||
+3
-3
@@ -7,7 +7,7 @@ class B : A() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
external class C : A() {
|
external class C : A() {
|
||||||
override fun f(x: Int) {}
|
override fun f(x: Int)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ open external class D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class E : D() {
|
class E : D() {
|
||||||
override fun f(x: Int) {}
|
override fun f(x: Int) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
class F : D(), I {
|
class F : D(), I {
|
||||||
@@ -32,7 +32,7 @@ class F : D(), I {
|
|||||||
}
|
}
|
||||||
|
|
||||||
external class G : D(), I {
|
external class G : D(), I {
|
||||||
override fun f(x: Int) {}
|
override fun f(x: Int)
|
||||||
}
|
}
|
||||||
|
|
||||||
open class X {
|
open class X {
|
||||||
|
|||||||
+3
-3
@@ -1,12 +1,12 @@
|
|||||||
external fun foo(a: String): Int = noImpl
|
external fun foo(a: String): Int = noImpl
|
||||||
|
|
||||||
external class Bar(b: Int, c: Char) {
|
external class Bar(b: Int, c: Char) {
|
||||||
fun baz(d: Int) {}
|
fun baz(d: Int) { noImpl }
|
||||||
}
|
}
|
||||||
|
|
||||||
external object Obj {
|
external object Obj {
|
||||||
fun test1(e: String) {}
|
fun test1(e: String) { noImpl }
|
||||||
object Nested {
|
object Nested {
|
||||||
fun test2(g: Int) {}
|
fun test2(g: Int) { noImpl }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -4,15 +4,15 @@ fun Int.foo(a: String): Int = noImpl
|
|||||||
|
|
||||||
external class Bar(b: Int, c: Char) {
|
external class Bar(b: Int, c: Char) {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun baz(d: Int) {}
|
fun baz(d: Int) { noImpl }
|
||||||
}
|
}
|
||||||
|
|
||||||
external object Obj {
|
external object Obj {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun test1(e: String) {}
|
fun test1(e: String) { noImpl }
|
||||||
|
|
||||||
object Nested {
|
object Nested {
|
||||||
@nativeInvoke
|
@nativeInvoke
|
||||||
fun test2(g: Int) {}
|
fun test2(g: Int) { noImpl }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -4,15 +4,15 @@ fun Int.foo(a: String, v: Int): Int = noImpl
|
|||||||
|
|
||||||
external class Bar(b: Int, c: Char) {
|
external class Bar(b: Int, c: Char) {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun baz(d: Int, v: Int) {}
|
fun baz(d: Int, v: Int) { noImpl }
|
||||||
}
|
}
|
||||||
|
|
||||||
external object Obj {
|
external object Obj {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun test1(e: String, v: Any) {}
|
fun test1(e: String, v: Any) { noImpl }
|
||||||
|
|
||||||
object Nested {
|
object Nested {
|
||||||
@nativeSetter
|
@nativeSetter
|
||||||
fun test2(g: Int, v: Any) {}
|
fun test2(g: Int, v: Any) { noImpl }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -569,6 +569,12 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib/native"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib/native"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("body.kt")
|
||||||
|
public void testBody() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/native/body.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("extensionFunctionAndProperty.kt")
|
@TestMetadata("extensionFunctionAndProperty.kt")
|
||||||
public void testExtensionFunctionAndProperty() throws Exception {
|
public void testExtensionFunctionAndProperty() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/native/extensionFunctionAndProperty.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/native/extensionFunctionAndProperty.kt");
|
||||||
|
|||||||
+1
@@ -75,6 +75,7 @@ private val DIAGNOSTIC_FACTORY_TO_RENDERER by lazy {
|
|||||||
put(ErrorsJs.INLINE_EXTERNAL_DECLARATION, "Inline external declaration")
|
put(ErrorsJs.INLINE_EXTERNAL_DECLARATION, "Inline external declaration")
|
||||||
put(ErrorsJs.NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE,
|
put(ErrorsJs.NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE,
|
||||||
"Only nullable properties of external interfaces are allowed to be non-abstract")
|
"Only nullable properties of external interfaces are allowed to be non-abstract")
|
||||||
|
put(ErrorsJs.WRONG_BODY_OF_EXTERNAL_DECLARATION, "Wrong body of external declaration. Must be either ' = noImpl' or { noImpl }")
|
||||||
|
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,8 +78,9 @@ public interface ErrorsJs {
|
|||||||
ERROR, PositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT);
|
ERROR, PositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT);
|
||||||
DiagnosticFactory0<KtDeclaration> INLINE_EXTERNAL_DECLARATION = DiagnosticFactory0.create(
|
DiagnosticFactory0<KtDeclaration> INLINE_EXTERNAL_DECLARATION = DiagnosticFactory0.create(
|
||||||
ERROR, PositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT);
|
ERROR, PositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT);
|
||||||
DiagnosticFactory0<KtDeclaration> NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE = DiagnosticFactory0.create(
|
DiagnosticFactory0<KtExpression> NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE = DiagnosticFactory0.create(
|
||||||
ERROR, PositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT);
|
ERROR, PositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT);
|
||||||
|
DiagnosticFactory0<KtExpression> WRONG_BODY_OF_EXTERNAL_DECLARATION = DiagnosticFactory0.create(ERROR);
|
||||||
|
|
||||||
@SuppressWarnings("UnusedDeclaration")
|
@SuppressWarnings("UnusedDeclaration")
|
||||||
Object _initializer = new Object() {
|
Object _initializer = new Object() {
|
||||||
|
|||||||
+34
-2
@@ -22,18 +22,22 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticSink
|
|||||||
import org.jetbrains.kotlin.js.PredefinedAnnotation
|
import org.jetbrains.kotlin.js.PredefinedAnnotation
|
||||||
import org.jetbrains.kotlin.js.translate.utils.AnnotationsUtils
|
import org.jetbrains.kotlin.js.translate.utils.AnnotationsUtils
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
import org.jetbrains.kotlin.name.FqNameUnsafe
|
||||||
import org.jetbrains.kotlin.psi.KtProperty
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.resolve.BindingContext
|
import org.jetbrains.kotlin.resolve.BindingContext
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||||
|
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||||
import org.jetbrains.kotlin.resolve.checkers.SimpleDeclarationChecker
|
import org.jetbrains.kotlin.resolve.checkers.SimpleDeclarationChecker
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny
|
import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperInterfaces
|
import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperInterfaces
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isExtension
|
import org.jetbrains.kotlin.resolve.descriptorUtil.isExtension
|
||||||
|
import org.jetbrains.kotlin.types.TypeUtils
|
||||||
import org.jetbrains.kotlin.utils.singletonOrEmptyList
|
import org.jetbrains.kotlin.utils.singletonOrEmptyList
|
||||||
|
|
||||||
object JsExternalChecker : SimpleDeclarationChecker {
|
object JsExternalChecker : SimpleDeclarationChecker {
|
||||||
|
val NO_IMPL_PROPERTY_NAME = FqNameUnsafe("kotlin.js.noImpl")
|
||||||
|
|
||||||
override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, diagnosticHolder: DiagnosticSink,
|
override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, diagnosticHolder: DiagnosticSink,
|
||||||
bindingContext: BindingContext) {
|
bindingContext: BindingContext) {
|
||||||
if (!AnnotationsUtils.isNativeObject(descriptor)) return
|
if (!AnnotationsUtils.isNativeObject(descriptor)) return
|
||||||
@@ -85,6 +89,34 @@ object JsExternalChecker : SimpleDeclarationChecker {
|
|||||||
) {
|
) {
|
||||||
diagnosticHolder.report(ErrorsJs.NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE.on(declaration))
|
diagnosticHolder.report(ErrorsJs.NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE.on(declaration))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkBody(declaration, diagnosticHolder, bindingContext)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkBody(declaration: KtDeclaration, diagnosticHolder: DiagnosticSink, bindingContext: BindingContext) {
|
||||||
|
if (declaration is KtDeclarationWithBody && !declaration.hasValidExternalBody(bindingContext)) {
|
||||||
|
reportWrongBody(declaration.bodyExpression!!, diagnosticHolder, bindingContext)
|
||||||
|
}
|
||||||
|
else if (declaration is KtDeclarationWithInitializer && declaration.initializer?.isNoImplExpression(bindingContext) == false) {
|
||||||
|
reportWrongBody(declaration.initializer!!, diagnosticHolder, bindingContext)
|
||||||
|
}
|
||||||
|
if (declaration is KtCallableDeclaration) {
|
||||||
|
for (defaultValue in declaration.valueParameters.mapNotNull { it.defaultValue }) {
|
||||||
|
checkExternalExpression(defaultValue, diagnosticHolder, bindingContext)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkExternalExpression(expression: KtExpression, diagnosticHolder: DiagnosticSink, bindingContext: BindingContext) {
|
||||||
|
if (!expression.isNoImplExpression(bindingContext)) {
|
||||||
|
reportWrongBody(expression, diagnosticHolder, bindingContext)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun reportWrongBody(expression: KtExpression, diagnosticHolder: DiagnosticSink, bindingContext: BindingContext) {
|
||||||
|
if (bindingContext.diagnostics.forElement(expression).none { it.factory == ErrorsJs.WRONG_BODY_OF_EXTERNAL_DECLARATION }) {
|
||||||
|
diagnosticHolder.report(ErrorsJs.WRONG_BODY_OF_EXTERNAL_DECLARATION.on(expression))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isDirectlyExternal(declaration: KtDeclaration, descriptor: DeclarationDescriptor): Boolean {
|
private fun isDirectlyExternal(declaration: KtDeclaration, descriptor: DeclarationDescriptor): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user