[IR] Introduce new IdSignatures
FileSignature, CompositeSignature, LocalSignature They are needed to make possible reference any non-local declaration via signature, including private signature, type parameters and so on. - Support those new signatures in proto and klibs - Rename `isPublic` -> `isPubliclyVisible` due to changed semantic - Fix FIR - clean up code
This commit is contained in:
committed by
TeamCityServer
parent
7139785036
commit
6cdac22a23
+2
-6
@@ -21,17 +21,13 @@ class JsUniqIdClashTracker : IdSignatureClashTracker {
|
||||
private val committedIdSignatures = mutableMapOf<IdSignature, IrDeclaration>()
|
||||
|
||||
override fun commit(declaration: IrDeclaration, signature: IdSignature) {
|
||||
if (!signature.isPublic) return // don't track local ids
|
||||
if (!signature.isPubliclyVisible) return // don't track local ids
|
||||
|
||||
if (signature in committedIdSignatures) {
|
||||
val clashedDeclaration = committedIdSignatures[signature]!!
|
||||
val parent = declaration.parent
|
||||
val clashedParent = clashedDeclaration.parent
|
||||
if (declaration is IrTypeParameter && parent is IrSimpleFunction && parent.parent is IrProperty && parent !== clashedParent) {
|
||||
// Check whether they are type parameters of the same extension property but different accessors
|
||||
require(clashedParent is IrSimpleFunction)
|
||||
require(clashedParent.correspondingPropertySymbol === parent.correspondingPropertySymbol)
|
||||
} else {
|
||||
if (declaration !is IrTypeParameter || parent !is IrSimpleFunction || clashedParent !is IrSimpleFunction || parent.correspondingPropertySymbol !== clashedParent.correspondingPropertySymbol) {
|
||||
// TODO: handle clashes properly
|
||||
error("IdSignature clash: $signature; Existed declaration ${clashedDeclaration.render()} clashed with new ${declaration.render()}")
|
||||
}
|
||||
|
||||
+1
-2
@@ -50,8 +50,7 @@ abstract class AbstractJsDescriptorMangler : DescriptorBasedKotlinManglerImpl()
|
||||
override fun DeclarationDescriptor.isPlatformSpecificExported() = false
|
||||
}
|
||||
|
||||
private class JsDescriptorManglerComputer(builder: StringBuilder, mode: MangleMode) :
|
||||
DescriptorMangleComputer(builder, mode) {
|
||||
private class JsDescriptorManglerComputer(builder: StringBuilder, mode: MangleMode) : DescriptorMangleComputer(builder, mode) {
|
||||
override fun copy(newMode: MangleMode): DescriptorMangleComputer = JsDescriptorManglerComputer(builder, newMode)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user