JS frontend: added tests for nativeInvoke, nativeGetter, nativeSetter.

This commit is contained in:
Zalim Bashorov
2014-11-25 21:30:33 +03:00
parent 99745dfa90
commit 31d4a8c226
66 changed files with 2428 additions and 7 deletions
@@ -0,0 +1,21 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo() {
[nativeSetter]
fun Int.set(a: String, v: Int) {}
[nativeSetter]
fun Int.set2(a: Number, v: String?) = "OK"
[nativeSetter]
fun Int.set3(a: Double, v: String?) = "OK"
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
fun Int.set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: Any<!>): Int?<!> = 1
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
fun Int.set2(): String?<!> = "OK"
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
fun Int.set3(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: Any<!>, b: Int, c: Any?)<!> {}
}
@@ -0,0 +1,3 @@
package
internal fun foo(): kotlin.Unit
@@ -0,0 +1,36 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo() {
[native]
class A {
nativeSetter
fun set(a: String, v: Any?): Any? = null
nativeSetter
fun put(a: Number, v: String) {}
nativeSetter
fun foo(a: Int, v: String) {}
}
[native]
class B {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
}
[native]
class C {
<!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?) {}
}
}
@@ -0,0 +1,3 @@
package
internal fun foo(): kotlin.Unit
@@ -0,0 +1,33 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo() {
class A {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun set(a: String, v: Any?): Any?<!> = null
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun put(a: Number, v: String)<!> {}
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun foo(a: Int, v: String)<!> {}
}
class B {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
var foo<!> = 0
}
class C {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun set(): Any?<!> = null
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = null
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun set(a: String, v: Any, v2: Any)<!> {}
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}
}
}
@@ -0,0 +1,3 @@
package
internal fun foo(): kotlin.Unit
@@ -0,0 +1,12 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
fun foo() {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
fun toplevelFun(): Any<!> = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeSetter]
val toplevelVal<!> = 0
[nativeSetter]
class <!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>Foo<!> {}
}
@@ -0,0 +1,3 @@
package
internal fun foo(): kotlin.Unit
@@ -0,0 +1,56 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
native
class A {
nativeSetter
fun set(a: String, v: Any?): Any? = null
nativeSetter
fun put(a: Number, v: String) {}
nativeSetter
fun foo(a: Int, v: String) {}
class object {
nativeSetter
fun set(a: String, v: Any?): Any? = null
nativeSetter
fun put(a: Number, v: String) {}
nativeSetter
fun foo(a: Int, v: String) {}
}
}
native
class B {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj1<!> {}
class object {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj2<!> {}
}
}
native
class C {
<!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?) {}
}
@@ -0,0 +1,76 @@
package
kotlin.js.native() internal final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
internal class object <class-object-for-A> {
private constructor <class-object-for-A>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
kotlin.js.native() internal final class B {
public constructor B()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
internal class object <class-object-for-B> {
private constructor <class-object-for-B>()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
kotlin.js.nativeSetter() internal object Obj2 {
private constructor Obj2()
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 toString(): kotlin.String
public class object <class-object-for-Obj2> : B.Obj2 {
private constructor <class-object-for-Obj2>()
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 toString(): kotlin.String
}
}
}
kotlin.js.nativeSetter() internal object Obj1 {
private constructor Obj1()
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 toString(): kotlin.String
public class object <class-object-for-Obj1> : B.Obj1 {
private constructor <class-object-for-Obj1>()
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 toString(): kotlin.String
}
}
}
kotlin.js.native() internal final class C {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,86 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
native
class A {
class B {
class A {
nativeSetter
fun set(a: String, v: Any?): Any? = null
nativeSetter
fun put(a: Number, v: String) {}
nativeSetter
fun foo(a: Int, v: String) {}
class object {
nativeSetter
fun set(a: String, v: Any?): Any? = null
nativeSetter
fun put(a: Number, v: String) {}
nativeSetter
fun foo(a: Int, v: String) {}
}
}
class B {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj1<!> {}
class object {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj2<!> {}
}
}
class C {
<!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?) {}
}
object obj {
<!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?) {}
}
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?) {}
}
}
}
@@ -0,0 +1,113 @@
package
kotlin.js.native() internal final class A {
public constructor A()
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 toString(): kotlin.String
internal final class B {
public constructor B()
internal 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
internal final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
internal class object <class-object-for-A> {
private constructor <class-object-for-A>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
internal final class B {
public constructor B()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
internal class object <class-object-for-B> {
private constructor <class-object-for-B>()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
kotlin.js.nativeSetter() internal object Obj2 {
private constructor Obj2()
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 toString(): kotlin.String
public class object <class-object-for-Obj2> : A.B.B.Obj2 {
private constructor <class-object-for-Obj2>()
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 toString(): kotlin.String
}
}
}
kotlin.js.nativeSetter() internal object Obj1 {
private constructor Obj1()
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 toString(): kotlin.String
public class object <class-object-for-Obj1> : A.B.B.Obj1 {
private constructor <class-object-for-Obj1>()
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 toString(): kotlin.String
}
}
}
internal final class C {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
internal object obj {
private constructor obj()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public class object <class-object-for-obj> : A.B.obj {
private constructor <class-object-for-obj>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(/*0*/ a: A.B.A): kotlin.Any?
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(/*0*/ a: A.B.A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
}
}
@@ -0,0 +1,86 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
native
class A {
class B {
class A {
nativeSetter
fun set(a: String, v: Any?): Any? = null
nativeSetter
fun put(a: Number, v: String) {}
nativeSetter
fun foo(a: Int, v: String) {}
class object {
nativeSetter
fun set(a: String, v: Any?): Any? = null
nativeSetter
fun put(a: Number, v: String) {}
nativeSetter
fun foo(a: Int, v: String) {}
}
}
class B {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj1<!> {}
class object {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj2<!> {}
}
}
class C {
<!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?) {}
}
object obj {
<!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?) {}
}
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?) {}
}
}
}
@@ -0,0 +1,113 @@
package
kotlin.js.native() internal final class A {
public constructor A()
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 toString(): kotlin.String
internal final class B {
public constructor B()
internal 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
internal final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
internal class object <class-object-for-A> {
private constructor <class-object-for-A>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
internal final class B {
public constructor B()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
internal class object <class-object-for-B> {
private constructor <class-object-for-B>()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
kotlin.js.nativeSetter() internal object Obj2 {
private constructor Obj2()
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 toString(): kotlin.String
public class object <class-object-for-Obj2> : A.B.B.Obj2 {
private constructor <class-object-for-Obj2>()
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 toString(): kotlin.String
}
}
}
kotlin.js.nativeSetter() internal object Obj1 {
private constructor Obj1()
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 toString(): kotlin.String
public class object <class-object-for-Obj1> : A.B.B.Obj1 {
private constructor <class-object-for-Obj1>()
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 toString(): kotlin.String
}
}
}
internal final class C {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
internal object obj {
private constructor obj()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A.B.A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public class object <class-object-for-obj> : A.B.obj {
private constructor <class-object-for-obj>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(/*0*/ a: A.B.A): kotlin.Any?
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(/*0*/ a: A.B.A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final override /*1*/ /*fake_override*/ fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
}
}
@@ -0,0 +1,53 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun set(a: String, v: Any?): Any?<!> = null
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun put(a: Number, v: String)<!> {}
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun foo(a: Int, v: String)<!> {}
class object {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun set(a: String, v: Any?): Any?<!> = null
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun put(a: Number, v: String)<!> {}
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun foo(a: Int, v: String)<!> {}
}
}
class B {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj1<!> {}
class object {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val foo<!> = 0
nativeSetter
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj2<!> {}
}
}
class C {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun set(): Any?<!> = null
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = null
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun set(a: String, v: Any, v2: Any)<!> {}
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}
}
@@ -0,0 +1,76 @@
package
internal final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
internal class object <class-object-for-A> {
private constructor <class-object-for-A>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeSetter() internal final fun foo(/*0*/ a: kotlin.Int, /*1*/ v: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun put(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any?): kotlin.Any?
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
internal final class B {
public constructor B()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
internal class object <class-object-for-B> {
private constructor <class-object-for-B>()
kotlin.js.nativeSetter() internal final val foo: kotlin.Int = 0
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 toString(): kotlin.String
kotlin.js.nativeSetter() internal object Obj2 {
private constructor Obj2()
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 toString(): kotlin.String
public class object <class-object-for-Obj2> : B.Obj2 {
private constructor <class-object-for-Obj2>()
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 toString(): kotlin.String
}
}
}
kotlin.js.nativeSetter() internal object Obj1 {
private constructor Obj1()
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 toString(): kotlin.String
public class object <class-object-for-Obj1> : B.Obj1 {
private constructor <class-object-for-Obj1>()
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 toString(): kotlin.String
}
}
}
internal final class C {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeSetter() internal final fun set(): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A): kotlin.Any?
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: A, /*1*/ v: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal final fun set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Any, /*2*/ v2: kotlin.Any): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,19 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
nativeSetter
fun Int.set(a: String, v: Int) {}
nativeSetter
fun Int.set2(a: Number, v: String?) = "OK"
nativeSetter
fun Int.set3(a: Double, v: String?) = "OK"
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun Int.set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: <!UNRESOLVED_REFERENCE!>A<!><!>): Int?<!> = 1
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun Int.set2(): String?<!> = "OK"
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun Int.set3(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: Any<!>, b: Int, c: Any?)<!> {}
@@ -0,0 +1,8 @@
package
kotlin.js.nativeSetter() internal fun kotlin.Int.set(/*0*/ a: [ERROR : A]): kotlin.Int?
kotlin.js.nativeSetter() internal fun kotlin.Int.set(/*0*/ a: kotlin.String, /*1*/ v: kotlin.Int): kotlin.Unit
kotlin.js.nativeSetter() internal fun kotlin.Int.set2(): kotlin.String?
kotlin.js.nativeSetter() internal fun kotlin.Int.set2(/*0*/ a: kotlin.Number, /*1*/ v: kotlin.String?): kotlin.String
kotlin.js.nativeSetter() internal fun kotlin.Int.set3(/*0*/ a: kotlin.Any, /*1*/ b: kotlin.Int, /*2*/ c: kotlin.Any?): kotlin.Unit
kotlin.js.nativeSetter() internal fun kotlin.Int.set3(/*0*/ a: kotlin.Double, /*1*/ v: kotlin.String?): kotlin.String
@@ -0,0 +1,10 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>nativeSetter
fun toplevelFun(): Any<!> = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
val toplevelVal<!> = 0
nativeSetter
class <!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>Foo<!> {}
@@ -0,0 +1,11 @@
package
kotlin.js.nativeSetter() internal val toplevelVal: kotlin.Int = 0
kotlin.js.nativeSetter() internal fun toplevelFun(): kotlin.Any
kotlin.js.nativeSetter() internal final class Foo {
public constructor Foo()
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 toString(): kotlin.String
}