[KT-4124] Add test case for nested native class

This commit is contained in:
Alexey Andreev
2016-02-15 14:27:25 +03:00
parent 68828317b8
commit 040a646174
3 changed files with 48 additions and 0 deletions
@@ -0,0 +1,16 @@
package foo
open class A {
@native class B(value: Int = 0) {
val foo: Int
get() = noImpl
fun bar(): Int = noImpl
}
}
fun box(): String {
var b = A.B(23)
if (b.foo != 123) return "failed1: ${b.foo}"
if (b.bar() != 1123) return "failed2: ${b.bar()}"
return "OK"
}
@@ -0,0 +1,7 @@
function B(value) {
this.foo = 100 + value;
}
B.prototype = {};
B.prototype.bar = function() {
return this.foo + 1000;
};