JS: fix definition nested classes inside interfaces
This commit is contained in:
@@ -34,6 +34,10 @@ public class NestedTypesTest extends SingleFileTranslationTest {
|
|||||||
checkFooBoxIsOk();
|
checkFooBoxIsOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNestedInInterface() throws Exception {
|
||||||
|
checkFooBoxIsOk();
|
||||||
|
}
|
||||||
|
|
||||||
public void testInner() throws Exception {
|
public void testInner() throws Exception {
|
||||||
checkFooBoxIsOk();
|
checkFooBoxIsOk();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -224,7 +224,7 @@ var Kotlin = {};
|
|||||||
copyProperties(obj.prototype, obj.$metadata$.functions);
|
copyProperties(obj.prototype, obj.$metadata$.functions);
|
||||||
Object.defineProperty(obj, "object", {get: class_object, configurable: true});
|
Object.defineProperty(obj, "object", {get: class_object, configurable: true});
|
||||||
|
|
||||||
defineNestedTypes(constructor, obj.$metadata$.types);
|
defineNestedTypes(obj, obj.$metadata$.types);
|
||||||
return obj;
|
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"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user