[K/JS] Support companion objects in external and exported declarations
This commit is contained in:
+8
-1
@@ -25,7 +25,14 @@ external interface GoodInterface
|
||||
|
||||
@JsExport
|
||||
interface InterfaceWithCompanion {
|
||||
companion <!WRONG_EXPORTED_DECLARATION("companion object inside exported interface")!>object<!> {
|
||||
companion object {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
@JsExport
|
||||
interface InterfaceWithNamedCompanion {
|
||||
companion <!NAMED_COMPANION_IN_EXPORTED_INTERFACE!>object Named<!> {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
+8
-1
@@ -25,7 +25,14 @@ external interface GoodInterface
|
||||
|
||||
@JsExport
|
||||
interface InterfaceWithCompanion {
|
||||
companion <!WRONG_EXPORTED_DECLARATION("companion object inside exported interface")!>object<!> {
|
||||
companion object {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
@JsExport
|
||||
interface InterfaceWithNamedCompanion {
|
||||
companion <!NAMED_COMPANION_IN_EXPORTED_INTERFACE!>object Named<!> {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -64,6 +64,20 @@ package foo {
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.js.JsExport public interface InterfaceWithNamedCompanion {
|
||||
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 companion object Named {
|
||||
private constructor Named()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.js.JsExport public interface OuterInterface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
+6
-2
@@ -9,5 +9,9 @@ external interface I {
|
||||
|
||||
enum class <!ENUM_CLASS_IN_EXTERNAL_DECLARATION_WARNING, NESTED_CLASS_IN_EXTERNAL_INTERFACE!>E<!>
|
||||
|
||||
companion <!NESTED_CLASS_IN_EXTERNAL_INTERFACE!>object<!>
|
||||
}
|
||||
companion object
|
||||
}
|
||||
|
||||
external interface I2 {
|
||||
companion <!NAMED_COMPANION_IN_EXTERNAL_INTERFACE!>object Named<!>
|
||||
}
|
||||
|
||||
+14
@@ -47,3 +47,17 @@ public external interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public external interface I2 {
|
||||
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 companion object Named {
|
||||
private constructor Named()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user