From a5e8d3dfc91953692c178ff91379668c1d46bd3c Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Tue, 30 Jan 2018 10:50:57 +0300 Subject: [PATCH] [kotlin compiler][update] 1.2-20180126.115605-180 (#1269) * [kotlin compiler][update] 1.2-20180126.115605-180 kotlinScriptRuntimeVersion=1.2-20180126.115623-180 kotlinStdLibVersion=1.2-20180126.115626-180 kotlinReflectVersion=1.2-20180126.115618-180 kotlinStdLibJdk8Version=1.2-20180126.115632-180 kotlinGradlePluginVersion=1.2-20180126.115615-180 * [build] Fix upload for Kotlin dependencies --- .../org/jetbrains/kotlin/backend/konan/ir/KonanIr.kt | 3 +++ .../backend/konan/lower/CallableReferenceLowering.kt | 7 ++++--- .../konan/lower/DeepCopyIrTreeWithDescriptors.kt | 3 ++- .../kotlin/backend/konan/lower/EnumClassLowering.kt | 2 +- .../kotlin/backend/konan/lower/InteropLowering.kt | 2 +- .../backend/konan/lower/SuspendFunctionsLowering.kt | 7 ++++--- .../konan/serialization/KonanDescriptorSerializer.kt | 4 ++-- .../konan/serialization/KonanSerializationUtil.kt | 2 +- .../backend/konan/serialization/SerializeIr.kt | 2 +- .../kotlin/ir/util/IrUnboundSymbolReplacer.kt | 2 +- dependencies/build.gradle | 2 +- gradle.properties | 12 ++++++------ 12 files changed, 27 insertions(+), 21 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/KonanIr.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/KonanIr.kt index 084f898362c..0ba4767b9a6 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/KonanIr.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/ir/KonanIr.kt @@ -29,6 +29,7 @@ import org.jetbrains.kotlin.ir.symbols.IrFileSymbol import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.konan.file.File +import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.types.KotlinType //-----------------------------------------------------------------------------// @@ -99,6 +100,8 @@ class IrFileImpl(entry: SourceManager.FileEntry) : IrFile { //-------------------------------------------------------------------------// + override val fqName: FqName + get() = TODO("not implemented") override val fileAnnotations: MutableList get() = TODO("not implemented") override val symbol: IrFileSymbol diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt index 37d366e62a6..5f18583fb41 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/CallableReferenceLowering.kt @@ -210,9 +210,6 @@ internal class CallableReferenceLowering(val context: Context): FileLoweringPass descriptor = functionReferenceClassDescriptor ) - functionReferenceClass.createParameterDeclarations() - - functionReferenceThis = functionReferenceClass.thisReceiver!!.symbol val constructorBuilder = createConstructorBuilder() @@ -235,6 +232,10 @@ internal class CallableReferenceLowering(val context: Context): FileLoweringPass functionReferenceClassDescriptor.initialize( SimpleMemberScope(contributedDescriptors), setOf(constructorBuilder.symbol.descriptor), null) + functionReferenceClass.createParameterDeclarations() + + functionReferenceThis = functionReferenceClass.thisReceiver!!.symbol + functionReferenceClass.addFakeOverrides() constructorBuilder.initialize() diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt index 30b21098177..b4b04cfac3c 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/DeepCopyIrTreeWithDescriptors.kt @@ -516,7 +516,8 @@ class DeepCopyIrTreeWithDescriptors(val targetDescriptor: FunctionDescriptor, startOffset = expression.startOffset, endOffset = expression.endOffset, type = newExpressionType, - descriptor = classDescriptor + descriptor = classDescriptor, + classType = expression.classType ) } diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt index f784b1ac180..76e021008e5 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/EnumClassLowering.kt @@ -251,7 +251,6 @@ internal class EnumClassLowering(val context: Context) : ClassLoweringPass { ClassKind.CLASS, listOf(descriptor.defaultType), SourceElement.NO_SOURCE, false) val defaultClass = IrClassImpl(startOffset, endOffset, IrDeclarationOrigin.DEFINED, defaultClassDescriptor) - defaultClass.createParameterDeclarations() val constructors = mutableSetOf() @@ -283,6 +282,7 @@ internal class EnumClassLowering(val context: Context) : ClassLoweringPass { .toList() defaultClassDescriptor.initialize(SimpleMemberScope(contributedDescriptors), constructors, null) + defaultClass.createParameterDeclarations() defaultClass.addFakeOverrides() return defaultClass diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt index af38c6070de..c97dc1e6b7a 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/InteropLowering.kt @@ -304,7 +304,7 @@ internal class InteropLoweringPart1(val context: Context) : IrBuildingTransforme context.interopBuiltIns.objCMethodImp.defaultType, mapOf("selector" to selector, "encoding" to encoding) .mapKeys { Name.identifier(it.key) } - .mapValues { StringValue(it.value, context.builtIns) }, + .mapValues { StringValue(it.value) }, SourceElement.NO_SOURCE ) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt index 99c73d35e92..3ca1a8d99e7 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/SuspendFunctionsLowering.kt @@ -337,9 +337,6 @@ internal class SuspendFunctionsLowering(val context: Context): DeclarationContai descriptor = coroutineClassDescriptor ) - coroutineClass.createParameterDeclarations() - - coroutineClassThis = coroutineClass.thisReceiver!!.symbol val overriddenMap = mutableMapOf() val constructors = mutableSetOf() @@ -386,6 +383,10 @@ internal class SuspendFunctionsLowering(val context: Context): DeclarationContai ).filterNotNull().toList() coroutineClassDescriptor.initialize(SimpleMemberScope(contributedDescriptors), constructors, null) + coroutineClass.createParameterDeclarations() + + coroutineClassThis = coroutineClass.thisReceiver!!.symbol + coroutineClass.addFakeOverrides() coroutineConstructorBuilder.initialize() diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDescriptorSerializer.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDescriptorSerializer.kt index 9cd7076a544..8845add0643 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDescriptorSerializer.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanDescriptorSerializer.kt @@ -648,14 +648,14 @@ class KonanDescriptorSerializer private constructor( proto.message = stringTable.getStringIndex(message) } - val level = (args[RequireKotlinNames.LEVEL] as? EnumValue)?.value?.name?.asString() + val level = (args[RequireKotlinNames.LEVEL] as? EnumValue)?.enumEntryName?.asString() when (level) { DeprecationLevel.ERROR.toString() -> { /* ERROR is the default level */ } DeprecationLevel.WARNING.toString() -> proto.level = ProtoBuf.VersionRequirement.Level.WARNING DeprecationLevel.HIDDEN.toString() -> proto.level = ProtoBuf.VersionRequirement.Level.HIDDEN } - val versionKind = (args[RequireKotlinNames.VERSION_KIND] as? EnumValue)?.value?.name?.asString() + val versionKind = (args[RequireKotlinNames.VERSION_KIND] as? EnumValue)?.enumEntryName?.asString() when (versionKind) { ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION.toString() -> { /* LANGUAGE_VERSION is the default kind */ } ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION.toString() -> diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt index d75ff52c7e0..59e2ac11430 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanSerializationUtil.kt @@ -105,7 +105,7 @@ fun createKonanPackageFragmentProvider( LocalClassifierTypeSettings.Default, ErrorReporter.DO_NOTHING, LookupTracker.DO_NOTHING, NullFlexibleTypeDeserializer, - emptyList(), notFoundClasses, ContractDeserializer.DEFAULT) + emptyList(), notFoundClasses, ContractDeserializer.DEFAULT, extensionRegistryLite = KonanSerializerProtocol.extensionRegistry ) for (packageFragment in packageFragments) { packageFragment.components = components diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt index e6b95b84f81..81bf5040437 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/SerializeIr.kt @@ -806,7 +806,7 @@ internal class IrDeserializer(val context: Context, fun deserializeClassReference(proto: KonanIr.IrClassReference, start: Int, end: Int, type: KotlinType): IrClassReference { val descriptor = deserializeDescriptor(proto.classDescriptor) as ClassifierDescriptor - return IrClassReferenceImpl(start, end, type, descriptor) + return IrClassReferenceImpl(start, end, type, descriptor, descriptor.defaultType) } fun deserializeCall(proto: KonanIr.IrCall, start: Int, end: Int, type: KotlinType): IrCall { diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUnboundSymbolReplacer.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUnboundSymbolReplacer.kt index c5a654f4659..b40552a420b 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUnboundSymbolReplacer.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/ir/util/IrUnboundSymbolReplacer.kt @@ -208,7 +208,7 @@ private class IrUnboundSymbolReplacer( expression.transformChildrenVoid(this) return with(expression) { - IrClassReferenceImpl(startOffset, endOffset, type, symbol) + IrClassReferenceImpl(startOffset, endOffset, type, symbol, symbol.descriptor.defaultType) } } diff --git a/dependencies/build.gradle b/dependencies/build.gradle index a1c57f9b0f9..6b3f8c71b70 100644 --- a/dependencies/build.gradle +++ b/dependencies/build.gradle @@ -129,8 +129,8 @@ uploads.each { target -> 'doc' : project.configurations.getByName("kotlin_${target}_doc").files.collect {it.path}, 'pom' : project.configurations.getByName("kotlin_${target}_pom").files.collect {it.path}, 'override': project.hasProperty("override") && project["override"] - ] + startParameter.useEmptySettings() } } diff --git a/gradle.properties b/gradle.properties index a0873dc1260..9d4641fecd7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,14 +23,14 @@ testDataVersion=1226829:id kotlinCompilerRepo=https://dl.bintray.com/jetbrains/kotlin-native-dependencies #kotlinCompilerRepo=http://oss.sonatype.org/content/repositories/snapshots #kotlinCompilerRepo=http://dl.bintray.com/kotlin/kotlin-dev -kotlinCompilerVersion=1.2-20180115.060358-133 -kotlinScriptRuntimeVersion=1.2-20180115.060416-133 -kotlinStdLibVersion=1.2-20180115.060420-133 -kotlinReflectVersion=1.2-20180115.060411-133 +kotlinCompilerVersion=1.2-20180126.115605-180 +kotlinScriptRuntimeVersion=1.2-20180126.115623-180 +kotlinStdLibVersion=1.2-20180126.115626-180 +kotlinReflectVersion=1.2-20180126.115618-180 konanVersion=0.5 org.gradle.jvmargs='-Dfile.encoding=UTF-8' ## # required for performance mesuarement tasks -kotlinStdLibJdk8Version=1.2-20180115.060426-133 -kotlinGradlePluginVersion=1.2-20180115.060407-133 +kotlinStdLibJdk8Version=1.2-20180126.115632-180 +kotlinGradlePluginVersion=1.2-20180126.115615-180