KT-40235 Fix external interface companion support
This commit is contained in:
committed by
Svyatoslav Kuzmich
parent
cc55580300
commit
7523a5e97f
-7
@@ -111,13 +111,6 @@ class IrElementToJsExpressionTransformer : BaseIrElementToJsNodeTransformer<JsEx
|
|||||||
assert(obj.kind == ClassKind.OBJECT)
|
assert(obj.kind == ClassKind.OBJECT)
|
||||||
assert(obj.isEffectivelyExternal()) { "Non external IrGetObjectValue must be lowered" }
|
assert(obj.isEffectivelyExternal()) { "Non external IrGetObjectValue must be lowered" }
|
||||||
|
|
||||||
// External interfaces cannot normally have companion objects.
|
|
||||||
// However, stdlib uses them to simulate string literal unions
|
|
||||||
// TODO: Stop abusing this tech
|
|
||||||
if (obj.isCompanion && obj.parentAsClass.isInterface) {
|
|
||||||
return JsNullLiteral()
|
|
||||||
}
|
|
||||||
|
|
||||||
return context.getRefForExternalClass(obj)
|
return context.getRefForExternalClass(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user