[K/Wasm] Add tests for nested external declarations + fix them

This commit is contained in:
Artem Kobzar
2024-01-22 11:55:09 +00:00
committed by Space Team
parent f15ca6a20f
commit 57a4d09ad2
3 changed files with 57 additions and 8 deletions
@@ -12,18 +12,37 @@ declare namespace not.exported.org.second {
}
declare namespace not.exported.org.second {
const Foo: {
get bar(): number;
get bar(): not.exported.Parent.OneMoreLayer.MentionedNested;
get baz(): string;
get oneMore(): not.exported.Parent.Companion.AnotherMentionedNested;
} & not.exported.Baz<string>;
}
declare namespace not.exported {
interface Baz<T> extends not.exported.Bar {
readonly baz?: T;
readonly bar: number;
readonly bar: not.exported.Parent.OneMoreLayer.MentionedNested;
readonly oneMore: not.exported.Parent.Companion.AnotherMentionedNested;
}
}
declare namespace not.exported.Parent.OneMoreLayer {
interface MentionedNested {
readonly value: typeof not.exported.MentionedParent;
}
}
declare namespace not.exported.Parent.Companion {
class AnotherMentionedNested {
constructor();
get value(): string;
}
}
declare namespace not.exported {
interface Bar {
readonly bar: number;
readonly bar: not.exported.Parent.OneMoreLayer.MentionedNested;
readonly oneMore: not.exported.Parent.Companion.AnotherMentionedNested;
}
}
declare namespace not.exported {
const MentionedParent: {
get value(): string;
};
}
@@ -3,8 +3,29 @@
// MODULE: main
// FILE: first.kt
external object MentionedParent {
val value: String
interface Nested {
val value: Int
}
}
external class Parent {
object OneMoreLayer {
interface MentionedNested {
val value: MentionedParent
}
}
companion object {
class AnotherMentionedNested {
val value: String
}
}
}
external interface Bar {
val bar: Int
val bar: Parent.OneMoreLayer.MentionedNested
val oneMore: Parent.Companion.AnotherMentionedNested
}
external interface Baz<T: JsAny?> : Bar {
@@ -18,8 +39,9 @@ import Bar
import Baz
external object Foo : Baz<JsString> {
override val bar: Int
override val bar: Parent.OneMoreLayer.MentionedNested
override val baz: JsString
override val oneMore: Parent.Companion.AnotherMentionedNested
}
external abstract class BaseResult<T: JsAny>(foo: Foo)