From a1a2da3c0f88305255cee4d1ce7088c4dc228cb7 Mon Sep 17 00:00:00 2001 From: Georgy Bronnikov Date: Wed, 15 Apr 2020 15:56:31 +0300 Subject: [PATCH] Revert "IR: put resolution of unbound type parameter symbols behind a language version flag" This reverts commit 9634e6fba3254d5bf255cf3f9151ad969f3677ab. --- .../fir/declarations/impl/FirClassImpl.kt | 2 +- .../declarations/impl/FirSealedClassImpl.kt | 2 +- .../ir/util/ExternalDependenciesGenerator.kt | 31 +++++++++---------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirClassImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirClassImpl.kt index bdab3457cdc..dd79976acbf 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirClassImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirClassImpl.kt @@ -62,7 +62,7 @@ internal class FirClassImpl( transformAnnotations(transformer, data) typeParameters.transformInplace(transformer, data) transformStatus(transformer, data) - transformDeclarations(transformer, data) + declarations.transformInplace(transformer, data) companionObject = declarations.asSequence().filterIsInstance().firstOrNull { it.status.isCompanion } superTypeRefs.transformInplace(transformer, data) transformControlFlowGraphReference(transformer, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSealedClassImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSealedClassImpl.kt index 671b13f1aa6..f386331c3ea 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSealedClassImpl.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/declarations/impl/FirSealedClassImpl.kt @@ -65,7 +65,7 @@ internal class FirSealedClassImpl( transformAnnotations(transformer, data) typeParameters.transformInplace(transformer, data) transformStatus(transformer, data) - transformDeclarations(transformer, data) + declarations.transformInplace(transformer, data) companionObject = declarations.asSequence().filterIsInstance().firstOrNull { it.status.isCompanion } superTypeRefs.transformInplace(transformer, data) transformControlFlowGraphReference(transformer, data) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt index 2047dd51796..26c792db6a5 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/ExternalDependenciesGenerator.kt @@ -53,25 +53,22 @@ class ExternalDependenciesGenerator( } } while (unbound.isNotEmpty()) } - - - private val SymbolTable.allUnbound: List - get() { - val r = mutableListOf() - r.addAll(unboundClasses) - r.addAll(unboundConstructors) - r.addAll(unboundEnumEntries) - r.addAll(unboundFields) - r.addAll(unboundSimpleFunctions) - r.addAll(unboundProperties) - r.addAll(unboundTypeAliases) - if (!languageVersionSettings.supportsFeature(LanguageFeature.NewInference)) { - r.addAll(unboundTypeParameters) - } - return r - } } +private val SymbolTable.allUnbound: List + get() { + val r = mutableListOf() + r.addAll(unboundClasses) + r.addAll(unboundConstructors) + r.addAll(unboundEnumEntries) + r.addAll(unboundFields) + r.addAll(unboundSimpleFunctions) + r.addAll(unboundProperties) + r.addAll(unboundTypeAliases) + r.addAll(unboundTypeParameters) + return r + } + fun List.getDeclaration(symbol: IrSymbol): IrDeclaration = firstNotNullResult { provider -> provider.getDeclaration(symbol)