JS frontend tests: add test cases with declare member extension functions.

This commit is contained in:
Zalim Bashorov
2014-12-01 16:19:34 +03:00
parent 990415b69f
commit 4c3073d03e
30 changed files with 336 additions and 7 deletions
@@ -9,6 +9,12 @@ fun foo() {
nativeInvoke
fun invoke(a: String): Int = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
val anonymous = object {
nativeInvoke
fun foo() {}
@@ -8,6 +8,12 @@ fun foo() {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun invoke(a: String): Int<!> = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
val anonymous = object {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun foo()<!> {}
@@ -8,11 +8,17 @@ class A {
nativeInvoke
fun invoke(a: String): Int = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
val foo<!> = 0
nativeInvoke
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj<!> {}
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj1<!> {}
class object {
nativeInvoke
@@ -20,5 +26,17 @@ class A {
nativeInvoke
fun invoke(a: String): Int = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
val foo<!> = 0
nativeInvoke
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>object Obj2<!> {}
}
}
@@ -1,4 +1,4 @@
package
package
kotlin.js.native() internal final class A {
public constructor A()
@@ -8,24 +8,43 @@ kotlin.js.native() internal final class A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
internal class object <class-object-for-A> {
private constructor <class-object-for-A>()
kotlin.js.nativeInvoke() internal final val foo: kotlin.Int = 0
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
kotlin.js.nativeInvoke() internal final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
kotlin.js.nativeInvoke() 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.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.nativeInvoke() internal object Obj {
private constructor Obj()
kotlin.js.nativeInvoke() 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-Obj> : A.Obj {
private constructor <class-object-for-Obj>()
public class object <class-object-for-Obj1> : A.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
@@ -9,6 +9,12 @@ class A {
nativeInvoke
fun invoke(a: String): Int = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
}
object obj {
@@ -17,6 +23,12 @@ class A {
nativeInvoke
fun invoke(a: String): Int = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
}
class object {
@@ -35,4 +47,4 @@ class A {
fun invoke(a: String): Int = 0
}
}
}
}
@@ -29,6 +29,8 @@ kotlin.js.native() internal final class A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
}
internal object obj {
@@ -38,6 +40,8 @@ kotlin.js.native() internal final class A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
public class object <class-object-for-obj> : A.B.obj {
private constructor <class-object-for-obj>()
@@ -46,6 +50,8 @@ kotlin.js.native() internal final class A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final override /*1*/ /*fake_override*/ fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final override /*1*/ /*fake_override*/ fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final override /*1*/ /*fake_override*/ fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
}
}
}
@@ -8,6 +8,12 @@ class A {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun invoke(a: String): Int<!> = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
}
object obj {
@@ -29,6 +29,8 @@ internal final class A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
}
internal object obj {
@@ -7,6 +7,12 @@ class A {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun invoke(a: String): Int<!> = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
val foo<!> = 0
@@ -19,5 +25,11 @@ class A {
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun invoke(a: String): Int<!> = 0
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.ext()<!> = 1
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeInvoke
fun Int.invoke(a: String, b: Int)<!> = "OK"
}
}
@@ -8,6 +8,8 @@ internal final class A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
internal class object <class-object-for-A> {
private constructor <class-object-for-A>()
@@ -16,6 +18,8 @@ internal final class A {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun invoke(/*0*/ a: kotlin.String): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
kotlin.js.nativeInvoke() internal final fun kotlin.Int.ext(): kotlin.Int
kotlin.js.nativeInvoke() internal final fun kotlin.Int.invoke(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int): kotlin.String
}
kotlin.js.nativeInvoke() internal object Obj {