[kotlin compiler][update] 1.3.50-dev-1390
This commit is contained in:
committed by
Vasily Levchenko
parent
a93fd4b518
commit
d8994435d6
-81
@@ -27,85 +27,4 @@ class KonanDescriptorReferenceDeserializer(
|
|||||||
override fun resolveSpecialDescriptor(fqn: FqName): DeclarationDescriptor = currentModule
|
override fun resolveSpecialDescriptor(fqn: FqName): DeclarationDescriptor = currentModule
|
||||||
override fun checkIfSpecialDescriptorId(id: Long): Boolean = false
|
override fun checkIfSpecialDescriptorId(id: Long): Boolean = false
|
||||||
override fun getDescriptorIdOrNull(descriptor: DeclarationDescriptor): Long? = null
|
override fun getDescriptorIdOrNull(descriptor: DeclarationDescriptor): Long? = null
|
||||||
|
|
||||||
// Most of this function duplicates the parent, but it deals with forward declarations.
|
|
||||||
// TODO: Refactor me.
|
|
||||||
override fun deserializeDescriptorReference(
|
|
||||||
packageFqNameString: String,
|
|
||||||
classFqNameString: String,
|
|
||||||
name: String,
|
|
||||||
index: Long?,
|
|
||||||
isEnumEntry: Boolean,
|
|
||||||
isEnumSpecial: Boolean,
|
|
||||||
isDefaultConstructor: Boolean,
|
|
||||||
isFakeOverride: Boolean,
|
|
||||||
isGetter: Boolean,
|
|
||||||
isSetter: Boolean,
|
|
||||||
isTypeParameter: Boolean
|
|
||||||
): DeclarationDescriptor {
|
|
||||||
val packageFqName = packageFqNameString.let {
|
|
||||||
if (it == "<root>") FqName.ROOT else FqName(it)
|
|
||||||
}// TODO: whould we store an empty string in the protobuf?
|
|
||||||
|
|
||||||
val classFqName = FqName(classFqNameString)
|
|
||||||
val protoIndex = index
|
|
||||||
|
|
||||||
val (clazz, members) = if (classFqNameString == "") {
|
|
||||||
Pair(null, getContributedDescriptors(packageFqNameString, name))
|
|
||||||
} else {
|
|
||||||
val clazz = currentModule.findClassAcrossModuleDependencies(ClassId(packageFqName, classFqName, false))!!
|
|
||||||
Pair(clazz, clazz.unsubstitutedMemberScope.getContributedDescriptors() + clazz.getConstructors())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (packageFqNameString.startsWith("cnames.") || packageFqNameString.startsWith("objcnames.")) {
|
|
||||||
val descriptor =
|
|
||||||
currentModule.findClassAcrossModuleDependencies(ClassId(packageFqName, FqName(name), false))!!
|
|
||||||
if (!descriptor.fqNameUnsafe.asString().startsWith("cnames") && !descriptor.fqNameUnsafe.asString().startsWith(
|
|
||||||
"objcnames"
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
if (descriptor is DeserializedClassDescriptor) {
|
|
||||||
val uniqId = UniqId(descriptor.getUniqId()!!, false)
|
|
||||||
val newKey = UniqIdKey(null, uniqId)
|
|
||||||
val oldKey = UniqIdKey(null, UniqId(protoIndex!!, false))
|
|
||||||
|
|
||||||
resolvedForwardDeclarations.put(oldKey, newKey)
|
|
||||||
} else {
|
|
||||||
/* ??? */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return descriptor
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isEnumEntry) {
|
|
||||||
val memberScope = (clazz as DeserializedClassDescriptor).getUnsubstitutedMemberScope()
|
|
||||||
return memberScope.getContributedClassifier(Name.identifier(name), NoLookupLocation.FROM_BACKEND)!!
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isEnumSpecial) {
|
|
||||||
return clazz!!.getStaticScope()
|
|
||||||
.getContributedFunctions(Name.identifier(name), NoLookupLocation.FROM_BACKEND).single()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isTypeParameter) {
|
|
||||||
return clazz!!.declaredTypeParameters.first { it.name.asString() == name }
|
|
||||||
}
|
|
||||||
|
|
||||||
val membersWithIndices = getMembers(members)
|
|
||||||
|
|
||||||
return when {
|
|
||||||
isDefaultConstructor -> membersWithIndices.defaultConstructor
|
|
||||||
|
|
||||||
else -> {
|
|
||||||
val map = if (isFakeOverride) membersWithIndices.realMembers else membersWithIndices.members
|
|
||||||
map[protoIndex]?.let { member ->
|
|
||||||
when {
|
|
||||||
member is PropertyDescriptor && isSetter -> member.setter!!
|
|
||||||
member is PropertyDescriptor && isGetter -> member.getter!!
|
|
||||||
else -> member
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ?: error("Could not find serialized descriptor for index: ${index} ${packageFqName},${classFqName},${name}")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -18,6 +18,7 @@ object KonanDescriptorUniqIdAware: DescriptorUniqIdAware {
|
|||||||
is DeserializedSimpleFunctionDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.functionUniqId)
|
is DeserializedSimpleFunctionDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.functionUniqId)
|
||||||
is DeserializedPropertyDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.propertyUniqId)
|
is DeserializedPropertyDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.propertyUniqId)
|
||||||
is DeserializedClassConstructorDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.constructorUniqId)
|
is DeserializedClassConstructorDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.constructorUniqId)
|
||||||
|
is DeserializedTypeParameterDescriptor -> this.proto.tryGetExtension(KonanProtoBuf.typeParamUniqId)
|
||||||
else -> null
|
else -> null
|
||||||
}?.index
|
}?.index
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -18,11 +18,11 @@
|
|||||||
buildKotlinVersion=1.3.50-dev-787
|
buildKotlinVersion=1.3.50-dev-787
|
||||||
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-787,branch:default:any,pinned:true/artifacts/content/maven
|
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-787,branch:default:any,pinned:true/artifacts/content/maven
|
||||||
remoteRoot=konan_tests
|
remoteRoot=konan_tests
|
||||||
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1062,branch:default:any,pinned:true/artifacts/content/maven
|
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1390,branch:default:any,pinned:true/artifacts/content/maven
|
||||||
kotlinVersion=1.3.50-dev-1062
|
kotlinVersion=1.3.50-dev-1390
|
||||||
kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1340,branch:default:any,pinned:true/artifacts/content/maven
|
kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.3.50-dev-1390,branch:default:any,pinned:true/artifacts/content/maven
|
||||||
kotlinStdlibVersion=1.3.50-dev-1340
|
kotlinStdlibVersion=1.3.50-dev-1390
|
||||||
testKotlinCompilerVersion=1.3.50-dev-630
|
testKotlinCompilerVersion=1.3.50-dev-1390
|
||||||
konanVersion=1.3.50
|
konanVersion=1.3.50
|
||||||
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
|
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
|
||||||
org.gradle.workers.max=4
|
org.gradle.workers.max=4
|
||||||
|
|||||||
Reference in New Issue
Block a user