[FE] Add isLocal name to ClassId constructor calls where it needed
This commit is contained in:
committed by
Space Team
parent
adaf8ae46a
commit
9e5ee3afa0
+1
-1
@@ -46,7 +46,7 @@ object JavaToKotlinClassMap {
|
||||
)
|
||||
|
||||
private inline fun <reified T> mutabilityMapping(kotlinReadOnly: ClassId, kotlinMutable: FqName): PlatformMutabilityMapping {
|
||||
val mutableClassId = ClassId(kotlinReadOnly.packageFqName, kotlinMutable.tail(kotlinReadOnly.packageFqName), false)
|
||||
val mutableClassId = ClassId(kotlinReadOnly.packageFqName, kotlinMutable.tail(kotlinReadOnly.packageFqName), isLocal = false)
|
||||
return PlatformMutabilityMapping(classId(T::class.java), kotlinReadOnly, mutableClassId)
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ data class CallableId(
|
||||
var classId: ClassId? = null
|
||||
get() {
|
||||
if (field == null && className != null) {
|
||||
field = ClassId(packageName, className, packageName == PACKAGE_FQ_NAME_FOR_LOCAL)
|
||||
field = ClassId(packageName, className, isLocal = packageName == PACKAGE_FQ_NAME_FOR_LOCAL)
|
||||
}
|
||||
return field
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.runIf
|
||||
* the second one being the class' short name.
|
||||
*/
|
||||
class ClassId(val packageFqName: FqName, val relativeClassName: FqName, val isLocal: Boolean) {
|
||||
constructor(packageFqName: FqName, topLevelName: Name) : this(packageFqName, FqName.topLevel(topLevelName), false)
|
||||
constructor(packageFqName: FqName, topLevelName: Name) : this(packageFqName, FqName.topLevel(topLevelName), isLocal = false)
|
||||
|
||||
init {
|
||||
assert(!relativeClassName.isRoot) { "Class name must not be root: " + packageFqName + if (isLocal) " (local)" else "" }
|
||||
@@ -53,7 +53,7 @@ class ClassId(val packageFqName: FqName, val relativeClassName: FqName, val isLo
|
||||
while (!name.parent().isRoot) {
|
||||
name = name.parent()
|
||||
}
|
||||
return ClassId(packageFqName, name, false)
|
||||
return ClassId(packageFqName, name, isLocal = false)
|
||||
}
|
||||
|
||||
val isNestedClass: Boolean
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ val Class<*>.classId: ClassId
|
||||
isArray -> throw IllegalArgumentException("Can't compute ClassId for array type: $this")
|
||||
enclosingMethod != null || enclosingConstructor != null || simpleName.isEmpty() -> {
|
||||
val fqName = FqName(name)
|
||||
ClassId(fqName.parent(), FqName.topLevel(fqName.shortName()), /* local = */ true)
|
||||
ClassId(fqName.parent(), FqName.topLevel(fqName.shortName()), isLocal = true)
|
||||
}
|
||||
else -> declaringClass?.classId?.createNestedClassId(Name.identifier(simpleName)) ?: ClassId.topLevel(FqName(name))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user