Fix internal-visibility mangling in IDE

Collect module name properly from facets settings, using CLI arguments
which define module name ('-module-name' on JVM and Common,
'-output-file' on JS).

^KT-23668 Fixed
This commit is contained in:
Dmitry Savvinov
2018-06-30 16:08:59 +03:00
parent 04f12846f1
commit 2783e9939b
18 changed files with 473 additions and 22 deletions
@@ -25,6 +25,11 @@ interface ModuleDescriptor : DeclarationDescriptor {
val builtIns: KotlinBuiltIns
/**
* Stable name of *Kotlin* module. Can be used for ABI (e.g. for mangling of declarations)
*/
val stableName: Name?
fun shouldSeeInternalsOf(targetModule: ModuleDescriptor): Boolean
override fun <R, D> accept(visitor: DeclarationDescriptorVisitor<R, D>, data: D): R {
@@ -35,7 +35,8 @@ class ModuleDescriptorImpl @JvmOverloads constructor(
override val builtIns: KotlinBuiltIns,
// May be null in compiler context, should be not-null in IDE context
multiTargetPlatform: MultiTargetPlatform? = null,
capabilities: Map<ModuleDescriptor.Capability<*>, Any?> = emptyMap()
capabilities: Map<ModuleDescriptor.Capability<*>, Any?> = emptyMap(),
override val stableName: Name? = null
) : DeclarationDescriptorImpl(Annotations.EMPTY, moduleName), ModuleDescriptor {
init {
if (!moduleName.isSpecial) {
@@ -74,6 +74,12 @@ public class ErrorUtils {
return Name.special("<ERROR MODULE>");
}
@NotNull
@Override
public Name getStableName() {
return Name.special("<ERROR MODULE>");
}
@NotNull
@Override
public PackageViewDescriptor getPackage(@NotNull FqName fqName) {