JS: fix definition nested classes inside interfaces

This commit is contained in:
Zalim Bashorov
2016-02-20 21:20:42 +03:00
parent 718c15806c
commit 82a049b319
3 changed files with 38 additions and 1 deletions
@@ -34,6 +34,10 @@ public class NestedTypesTest extends SingleFileTranslationTest {
checkFooBoxIsOk();
}
public void testNestedInInterface() throws Exception {
checkFooBoxIsOk();
}
public void testInner() throws Exception {
checkFooBoxIsOk();
}
+1 -1
View File
@@ -224,7 +224,7 @@ var Kotlin = {};
copyProperties(obj.prototype, obj.$metadata$.functions);
Object.defineProperty(obj, "object", {get: class_object, configurable: true});
defineNestedTypes(constructor, obj.$metadata$.types);
defineNestedTypes(obj, obj.$metadata$.types);
return obj;
};
@@ -0,0 +1,33 @@
package foo
interface A {
fun foo(): String
fun bar() = "A.bar;"
class B {
fun foo() = "A.B.foo;"
fun bar() = "A.B.bar;"
}
class C : A {
override fun foo() = "A.C.foo;"
}
class D : A {
override fun foo() = "A.D.foo;"
override fun bar() = "A.D.bar;"
}
}
fun box(): String {
assertEquals("A.B.foo;", A.B().foo())
assertEquals("A.B.bar;", A.B().bar())
assertEquals("A.C.foo;", A.C().foo())
assertEquals("A.bar;", A.C().bar())
assertEquals("A.D.foo;", A.D().foo())
assertEquals("A.D.bar;", A.D().bar())
return "OK"
}