From 17d4551443af3a5a09cb4f746114fa7bb0ef3463 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Fri, 11 Jul 2025 10:01:13 -0700 Subject: [PATCH 1/5] Switch TypeApplications to exported extensions --- .../tools/dotc/core/TypeApplications.scala | 22 ++++++++----------- .../src/dotty/tools/dotc/core/Types.scala | 8 +++---- .../quoted/runtime/impl/QuotesImpl.scala | 4 ++-- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 30bd3c168269..6bf529872ce4 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -18,12 +18,6 @@ object TypeApplications { type TypeParamInfo = ParamInfo.Of[TypeName] - /** Assert type is not a TypeBounds instance and return it unchanged */ - def noBounds(tp: Type): Type = tp match { - case tp: TypeBounds => throw new AssertionError("no TypeBounds allowed") - case _ => tp - } - /** Extractor for * * [X1: B1, ..., Xn: Bn] -> C[X1, ..., Xn] @@ -154,13 +148,9 @@ object TypeApplications { mapOver(t) } } -} - -import TypeApplications.* - -/** A decorator that provides methods for modeling type application */ -class TypeApplications(val self: Type) extends AnyVal { + // Extensions that model type application. + extension (self: Type) { /** The type parameters of this type are: * For a ClassInfo type, the type parameters of its class. * For a typeref referring to a class, the type parameters of the class. @@ -562,7 +552,7 @@ class TypeApplications(val self: Type) extends AnyVal { case _ => self.dropDependentRefinement.dealias.argInfos /** Argument types where existential types in arguments are disallowed */ - def argTypes(using Context): List[Type] = argInfos mapConserve noBounds + def argTypes(using Context): List[Type] = argInfos.mapConserve(_.noBounds) /** Argument types where existential types in arguments are approximated by their lower bound */ def argTypesLo(using Context): List[Type] = argInfos.mapConserve(_.loBound) @@ -596,4 +586,10 @@ class TypeApplications(val self: Type) extends AnyVal { .orElse(self.baseType(defn.ArrayClass)) .argInfos.headOption.getOrElse(NoType) } + + /** Assert type is not a TypeBounds instance and return it unchanged */ + def noBounds: self.type = + assert(!self.isInstanceOf[TypeBounds], "no TypeBounds allowed") + self + } } diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 6bf19c5a27a1..15ae322d8c36 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -4469,10 +4469,10 @@ object Types extends TypeUtils { setVariances(tparams.tail, vs.tail) override val isDeclaredVarianceLambda = variances.nonEmpty - if isDeclaredVarianceLambda then setVariances(typeParams, variances) + if isDeclaredVarianceLambda then setVariances(this.typeParams, variances) def declaredVariances = - if isDeclaredVarianceLambda then typeParams.map(_.declaredVariance) + if isDeclaredVarianceLambda then this.typeParams.map(_.declaredVariance) else Nil override def computeHash(bs: Binders): Int = @@ -4485,7 +4485,7 @@ object Types extends TypeUtils { paramNames.eqElements(that.paramNames) && isDeclaredVarianceLambda == that.isDeclaredVarianceLambda && (!isDeclaredVarianceLambda - || typeParams.corresponds(that.typeParams)((x, y) => + || this.typeParams.corresponds(that.typeParams)((x, y) => x.declaredVariance == y.declaredVariance)) && { val bs1 = new SomeBinderPairs(this, that, bs) @@ -7302,7 +7302,7 @@ object Types extends TypeUtils { // ----- Helpers and Decorator implicits -------------------------------------- - implicit def decorateTypeApplications(tpe: Type): TypeApplications = new TypeApplications(tpe) + export TypeApplications.{EtaExpandIfHK as _, EtaExpansion as _, TypeParamInfo as _, *} extension (tps1: List[Type]) { @tailrec def hashIsStable: Boolean = diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 3a7f7704edff..75cc2e9b495e 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -1911,9 +1911,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler dotc.core.Symbols.defn.isTupleNType(self) def select(sym: Symbol): TypeRepr = self.select(sym) def appliedTo(targ: TypeRepr): TypeRepr = - dotc.core.Types.decorateTypeApplications(self).appliedTo(targ) + dotc.core.Types.appliedTo(self)(targ) def appliedTo(targs: List[TypeRepr]): TypeRepr = - dotc.core.Types.decorateTypeApplications(self).appliedTo(targs) + dotc.core.Types.appliedTo(self)(targs) def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr = self.subst(from, to) From d825002e200f458bc9e4e291adb720908bf65844 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Fri, 11 Jul 2025 16:41:51 -0700 Subject: [PATCH 2/5] Switch TypeApplications from export to given --- .../src/dotty/tools/dotc/core/TypeApplications.scala | 11 +++++++---- compiler/src/dotty/tools/dotc/core/Types.scala | 11 ++++++----- .../src/scala/quoted/runtime/impl/QuotesImpl.scala | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 6bf529872ce4..e1d4633e3ca4 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -14,7 +14,7 @@ import StdNames.nme import Flags.{Module, Provisional} import dotty.tools.dotc.config.Config -object TypeApplications { +object TypeApplications: type TypeParamInfo = ParamInfo.Of[TypeName] @@ -149,8 +149,12 @@ object TypeApplications { } } - // Extensions that model type application. - extension (self: Type) { +/** Extensions that model type application. + */ +trait TypeApplications: + import TypeApplications.* + + extension (self: Type) { // braces to avoid indent /** The type parameters of this type are: * For a ClassInfo type, the type parameters of its class. * For a typeref referring to a class, the type parameters of the class. @@ -592,4 +596,3 @@ object TypeApplications { assert(!self.isInstanceOf[TypeBounds], "no TypeBounds allowed") self } -} diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 15ae322d8c36..63f86565a180 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2169,6 +2169,9 @@ object Types extends TypeUtils { /** Is the `hash` of this type the same for all possible sequences of enclosing binders? */ def hashIsStable: Boolean = true } + object Type: + // Extensions that model type application. + given TypeApplications() // end Type @@ -4469,10 +4472,10 @@ object Types extends TypeUtils { setVariances(tparams.tail, vs.tail) override val isDeclaredVarianceLambda = variances.nonEmpty - if isDeclaredVarianceLambda then setVariances(this.typeParams, variances) + if isDeclaredVarianceLambda then setVariances(typeParams, variances) def declaredVariances = - if isDeclaredVarianceLambda then this.typeParams.map(_.declaredVariance) + if isDeclaredVarianceLambda then typeParams.map(_.declaredVariance) else Nil override def computeHash(bs: Binders): Int = @@ -4485,7 +4488,7 @@ object Types extends TypeUtils { paramNames.eqElements(that.paramNames) && isDeclaredVarianceLambda == that.isDeclaredVarianceLambda && (!isDeclaredVarianceLambda - || this.typeParams.corresponds(that.typeParams)((x, y) => + || typeParams.corresponds(that.typeParams)((x, y) => x.declaredVariance == y.declaredVariance)) && { val bs1 = new SomeBinderPairs(this, that, bs) @@ -7302,8 +7305,6 @@ object Types extends TypeUtils { // ----- Helpers and Decorator implicits -------------------------------------- - export TypeApplications.{EtaExpandIfHK as _, EtaExpansion as _, TypeParamInfo as _, *} - extension (tps1: List[Type]) { @tailrec def hashIsStable: Boolean = tps1.isEmpty || tps1.head.hashIsStable && tps1.tail.hashIsStable diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 75cc2e9b495e..4cc4d4e99e3f 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -1911,9 +1911,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler dotc.core.Symbols.defn.isTupleNType(self) def select(sym: Symbol): TypeRepr = self.select(sym) def appliedTo(targ: TypeRepr): TypeRepr = - dotc.core.Types.appliedTo(self)(targ) + Types.Type.given_TypeApplications.appliedTo(self)(targ) def appliedTo(targs: List[TypeRepr]): TypeRepr = - dotc.core.Types.appliedTo(self)(targs) + Types.Type.given_TypeApplications.appliedTo(self)(targs) def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr = self.subst(from, to) From ed10f45d5b8ad4ccfe2985ed19c0ddf9e885008b Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Mon, 14 Jul 2025 03:16:42 -0700 Subject: [PATCH 3/5] Switch TypeApplications to extensions for import --- .../dotty/tools/backend/jvm/BCodeBodyBuilder.scala | 1 + .../dotty/tools/backend/jvm/BCodeSkelBuilder.scala | 1 + .../src/dotty/tools/debug/ExtractExpression.scala | 1 + .../src/dotty/tools/debug/ResolveReflectEval.scala | 1 + compiler/src/dotty/tools/dotc/ast/Desugar.scala | 1 + compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala | 1 + compiler/src/dotty/tools/dotc/ast/MainProxies.scala | 1 + compiler/src/dotty/tools/dotc/ast/TreeInfo.scala | 1 + compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala | 1 + compiler/src/dotty/tools/dotc/ast/Trees.scala | 1 + compiler/src/dotty/tools/dotc/ast/tpd.scala | 1 + compiler/src/dotty/tools/dotc/ast/untpd.scala | 1 + compiler/src/dotty/tools/dotc/cc/CaptureSet.scala | 1 + compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala | 1 + compiler/src/dotty/tools/dotc/cc/Setup.scala | 1 + compiler/src/dotty/tools/dotc/core/Annotations.scala | 1 + .../src/dotty/tools/dotc/core/CheckRealizable.scala | 1 + compiler/src/dotty/tools/dotc/core/Comments.scala | 1 + .../dotty/tools/dotc/core/ConstraintHandling.scala | 1 + compiler/src/dotty/tools/dotc/core/Contexts.scala | 1 + compiler/src/dotty/tools/dotc/core/Definitions.scala | 1 + compiler/src/dotty/tools/dotc/core/NamerOps.scala | 2 +- .../tools/dotc/core/PatternTypeConstrainer.scala | 1 + .../src/dotty/tools/dotc/core/SymDenotations.scala | 2 +- compiler/src/dotty/tools/dotc/core/Symbols.scala | 1 + .../src/dotty/tools/dotc/core/TypeApplications.scala | 11 ++++------- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 1 + compiler/src/dotty/tools/dotc/core/TypeErasure.scala | 1 + compiler/src/dotty/tools/dotc/core/TypeEval.scala | 1 + compiler/src/dotty/tools/dotc/core/TypeOps.scala | 1 + compiler/src/dotty/tools/dotc/core/TypeUtils.scala | 1 + compiler/src/dotty/tools/dotc/core/Types.scala | 7 ++----- compiler/src/dotty/tools/dotc/core/Variances.scala | 2 +- .../tools/dotc/core/classfile/ClassfileParser.scala | 1 + .../dotty/tools/dotc/core/tasty/TreeUnpickler.scala | 1 + .../dotc/core/unpickleScala2/Scala2Unpickler.scala | 1 + compiler/src/dotty/tools/dotc/inlines/Inliner.scala | 1 + compiler/src/dotty/tools/dotc/inlines/Inlines.scala | 1 + .../dotty/tools/dotc/inlines/PrepareInlineable.scala | 1 + .../src/dotty/tools/dotc/interactive/Completion.scala | 1 + .../src/dotty/tools/dotc/parsing/JavaParsers.scala | 1 + .../src/dotty/tools/dotc/printing/PlainPrinter.scala | 1 + .../src/dotty/tools/dotc/quoted/QuotePatterns.scala | 1 + .../src/dotty/tools/dotc/reporting/messages.scala | 1 + compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala | 1 + .../src/dotty/tools/dotc/semanticdb/TypeOps.scala | 1 + .../dotty/tools/dotc/staging/CrossStageSafety.scala | 1 + compiler/src/dotty/tools/dotc/staging/HealType.scala | 1 + .../dotty/tools/dotc/transform/AccessProxies.scala | 1 + compiler/src/dotty/tools/dotc/transform/Bridges.scala | 1 + .../src/dotty/tools/dotc/transform/CapturedVars.scala | 1 + .../src/dotty/tools/dotc/transform/Constructors.scala | 1 + .../src/dotty/tools/dotc/transform/ElimByName.scala | 1 + .../src/dotty/tools/dotc/transform/ElimRepeated.scala | 1 + compiler/src/dotty/tools/dotc/transform/Erasure.scala | 1 + .../src/dotty/tools/dotc/transform/ExpandSAMs.scala | 1 + .../dotty/tools/dotc/transform/ExplicitOuter.scala | 1 + .../dotty/tools/dotc/transform/FirstTransform.scala | 1 + .../tools/dotc/transform/FullParameterization.scala | 1 + .../tools/dotc/transform/FunctionXXLForwarders.scala | 1 + .../tools/dotc/transform/GenericSignatures.scala | 1 + .../dotty/tools/dotc/transform/HoistSuperArgs.scala | 1 + .../tools/dotc/transform/InstrumentCoverage.scala | 1 + .../dotty/tools/dotc/transform/Instrumentation.scala | 1 + .../tools/dotc/transform/InterceptedMethods.scala | 1 + .../src/dotty/tools/dotc/transform/LazyVals.scala | 1 + compiler/src/dotty/tools/dotc/transform/Memoize.scala | 1 + compiler/src/dotty/tools/dotc/transform/Mixin.scala | 1 + .../src/dotty/tools/dotc/transform/MixinOps.scala | 1 + .../dotty/tools/dotc/transform/NonLocalReturns.scala | 1 + .../dotty/tools/dotc/transform/OverridingPairs.scala | 1 + .../dotty/tools/dotc/transform/PatternMatcher.scala | 1 + .../src/dotty/tools/dotc/transform/PickleQuotes.scala | 1 + .../src/dotty/tools/dotc/transform/PostTyper.scala | 1 + compiler/src/dotty/tools/dotc/transform/Recheck.scala | 1 + .../dotty/tools/dotc/transform/ReifiedReflect.scala | 1 + .../tools/dotc/transform/SpecializeApplyMethods.scala | 1 + .../tools/dotc/transform/SpecializeFunctions.scala | 1 + .../src/dotty/tools/dotc/transform/Splicing.scala | 1 + .../dotty/tools/dotc/transform/SyntheticMembers.scala | 1 + .../src/dotty/tools/dotc/transform/TreeChecker.scala | 3 ++- .../tools/dotc/transform/TupleOptimizations.scala | 1 + .../dotty/tools/dotc/transform/TypeTestsCasts.scala | 1 + .../tools/dotc/transform/UnrollDefinitions.scala | 1 + .../dotty/tools/dotc/transform/VCInlineMethods.scala | 1 + .../src/dotty/tools/dotc/transform/init/Objects.scala | 1 + .../transform/localopt/StringInterpolatorOpt.scala | 1 + .../src/dotty/tools/dotc/transform/patmat/Space.scala | 1 + .../tools/dotc/transform/sjs/AddLocalJSFakeNews.scala | 1 + .../tools/dotc/transform/sjs/ExplicitJSClasses.scala | 1 + .../tools/dotc/transform/sjs/JUnitBootstrappers.scala | 1 + .../tools/dotc/transform/sjs/PrepJSExports.scala | 1 + .../tools/dotc/transform/sjs/PrepJSInterop.scala | 1 + .../src/dotty/tools/dotc/typer/Applications.scala | 2 +- compiler/src/dotty/tools/dotc/typer/Checking.scala | 1 + compiler/src/dotty/tools/dotc/typer/Deriving.scala | 1 + compiler/src/dotty/tools/dotc/typer/Dynamic.scala | 1 + .../src/dotty/tools/dotc/typer/EtaExpansion.scala | 1 + compiler/src/dotty/tools/dotc/typer/Implicits.scala | 1 + compiler/src/dotty/tools/dotc/typer/Inferencing.scala | 1 + compiler/src/dotty/tools/dotc/typer/Namer.scala | 1 + compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala | 1 + .../src/dotty/tools/dotc/typer/QuotesAndSplices.scala | 1 + compiler/src/dotty/tools/dotc/typer/ReTyper.scala | 1 + compiler/src/dotty/tools/dotc/typer/RefChecks.scala | 1 + compiler/src/dotty/tools/dotc/typer/Synthesizer.scala | 1 + .../src/dotty/tools/dotc/typer/TypeAssigner.scala | 1 + compiler/src/dotty/tools/dotc/typer/Typer.scala | 3 ++- .../src/dotty/tools/dotc/typer/VarianceChecker.scala | 1 + compiler/src/dotty/tools/dotc/util/Signatures.scala | 1 + .../src/scala/quoted/runtime/impl/QuoteMatcher.scala | 1 + .../src/scala/quoted/runtime/impl/QuotesImpl.scala | 5 +++-- compiler/test/dotty/tools/AnnotationsTests.scala | 1 + compiler/test/dotty/tools/SignatureTest.scala | 1 + .../tools/dotc/transform/patmat/SpaceEngineTest.scala | 1 + .../dotty/tools/pc/completions/CompletionValue.scala | 1 + .../main/dotty/tools/pc/completions/Completions.scala | 1 + .../tools/pc/completions/MatchCaseCompletions.scala | 1 + 118 files changed, 126 insertions(+), 20 deletions(-) diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala index 41f295d11ef1..203c3ce839a4 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala @@ -16,6 +16,7 @@ import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.core.Constants.* import dotty.tools.dotc.core.Flags.{Label => LabelFlag, _} import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.StdNames.{nme, str} import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.transform.Erasure diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala index f8185098390a..6b02be08f0c5 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala @@ -17,6 +17,7 @@ import dotty.tools.dotc.core.NameKinds.* import dotty.tools.dotc.core.Names.TermName import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.util.Spans.* import dotty.tools.dotc.report diff --git a/compiler/src/dotty/tools/debug/ExtractExpression.scala b/compiler/src/dotty/tools/debug/ExtractExpression.scala index 151d75270c6e..7670069b170f 100644 --- a/compiler/src/dotty/tools/debug/ExtractExpression.scala +++ b/compiler/src/dotty/tools/debug/ExtractExpression.scala @@ -8,6 +8,7 @@ import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.DenotTransformers.DenotTransformer import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.SymDenotations.SymDenotation diff --git a/compiler/src/dotty/tools/debug/ResolveReflectEval.scala b/compiler/src/dotty/tools/debug/ResolveReflectEval.scala index f79aa462fcb4..05290de889d9 100644 --- a/compiler/src/dotty/tools/debug/ResolveReflectEval.scala +++ b/compiler/src/dotty/tools/debug/ResolveReflectEval.scala @@ -12,6 +12,7 @@ import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.TypeErasure.ErasedValueType import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.report import dotty.tools.dotc.transform.MegaPhase.MiniPhase import dotty.tools.dotc.transform.ValueClasses diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 8471b06b7e97..ed0e39030b33 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -4,6 +4,7 @@ package ast import core.* import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, NameOps.*, Flags.* +import TypeApplications.* import Symbols.*, StdNames.*, Trees.*, ContextOps.* import Decorators.* import Annotations.Annotation diff --git a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala index 7268ec720ce2..0ffd6688647f 100644 --- a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala +++ b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala @@ -4,6 +4,7 @@ package ast import core.* import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, Flags.* +import TypeApplications.* import Symbols.*, StdNames.*, Trees.* import Decorators.* import util.{Property, SourceFile} diff --git a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala index 8d5cd8d5d689..d5942485f0fb 100644 --- a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala +++ b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala @@ -3,6 +3,7 @@ package ast import core.* import Symbols.*, Types.*, Contexts.*, Decorators.*, util.Spans.*, Flags.*, Constants.* +import TypeApplications.* import StdNames.{nme, tpnme} import ast.Trees.* import Names.Name diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index 8c6303d07b9a..c7dcdc0e534a 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -4,6 +4,7 @@ package ast import core.* import Flags.*, Trees.*, Types.*, Contexts.* +import TypeApplications.* import Names.*, StdNames.*, NameOps.*, Symbols.* import Annotations.Annotation import NameKinds.ContextBoundParamName diff --git a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala index dc8d9c700700..0f6a4d091c14 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala @@ -4,6 +4,7 @@ package ast import core.* import Types.*, Contexts.*, Flags.* +import TypeApplications.* import Symbols.*, Annotations.*, Trees.*, Symbols.*, Constants.Constant import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index ef64a025805a..5849f9fb4d73 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -4,6 +4,7 @@ package ast import core.* import Types.*, Names.*, NameOps.*, Flags.*, util.Spans.*, Contexts.*, Constants.* +import TypeApplications.* import typer.{ ConstFold, ProtoTypes } import SymDenotations.*, Symbols.*, Denotations.*, StdNames.*, Comments.* import collection.mutable.ListBuffer diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala index 909387bbb809..cdf6faba755a 100644 --- a/compiler/src/dotty/tools/dotc/ast/tpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala @@ -7,6 +7,7 @@ import typer.ProtoTypes import core.* import Scopes.newScope import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, Flags.*, NameOps.* +import TypeApplications.* import Symbols.*, StdNames.*, Annotations.*, Trees.*, Symbols.* import Decorators.*, DenotTransformers.* import collection.{immutable, mutable} diff --git a/compiler/src/dotty/tools/dotc/ast/untpd.scala b/compiler/src/dotty/tools/dotc/ast/untpd.scala index bad70cb3a01c..84a9a9f22dc5 100644 --- a/compiler/src/dotty/tools/dotc/ast/untpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/untpd.scala @@ -4,6 +4,7 @@ package ast import core.* import Types.*, Contexts.*, Constants.*, Names.*, Flags.* +import TypeApplications.* import dotty.tools.dotc.typer.ProtoTypes import Symbols.*, StdNames.*, Trees.* import util.{Property, SourceFile, NoSource} diff --git a/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala b/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala index 6ee57a058799..49925a7d2b25 100644 --- a/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala +++ b/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala @@ -4,6 +4,7 @@ package cc import core.* import Types.*, Symbols.*, Flags.*, Contexts.*, Decorators.* +import TypeApplications.* import config.Printers.{capt, captDebug} import Annotations.Annotation import annotation.threadUnsafe diff --git a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala index 92fa632f5166..ab05d71e1663 100644 --- a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala +++ b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala @@ -6,6 +6,7 @@ import core.* import Phases.*, DenotTransformers.*, SymDenotations.* import Contexts.*, Names.*, Flags.*, Symbols.*, Decorators.* import Types.*, StdNames.*, Denotations.* +import TypeApplications.* import config.Printers.{capt, recheckr, noPrinter} import config.{Config, Feature} import ast.{tpd, untpd, Trees} diff --git a/compiler/src/dotty/tools/dotc/cc/Setup.scala b/compiler/src/dotty/tools/dotc/cc/Setup.scala index 9c5ab335d99b..1cf4c3c8bf22 100644 --- a/compiler/src/dotty/tools/dotc/cc/Setup.scala +++ b/compiler/src/dotty/tools/dotc/cc/Setup.scala @@ -6,6 +6,7 @@ import core.* import Phases.*, DenotTransformers.*, SymDenotations.* import Contexts.*, Names.*, Flags.*, Symbols.*, Decorators.* import Types.*, StdNames.* +import TypeApplications.* import Annotations.Annotation import config.Feature import config.Printers.{capt, captDebug} diff --git a/compiler/src/dotty/tools/dotc/core/Annotations.scala b/compiler/src/dotty/tools/dotc/core/Annotations.scala index 1615679a036e..e6a67c1f942f 100644 --- a/compiler/src/dotty/tools/dotc/core/Annotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Annotations.scala @@ -3,6 +3,7 @@ package dotc package core import Symbols.*, Types.*, Contexts.*, Constants.*, Phases.* +import TypeApplications.* import ast.tpd, tpd.* import util.Spans.Span import printing.{Showable, Printer} diff --git a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala index bead5ac6e74e..c08b0304c5e1 100644 --- a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala +++ b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala @@ -3,6 +3,7 @@ package dotc package core import Contexts.*, Types.*, Symbols.*, Names.*, Flags.* +import TypeApplications.* import Denotations.SingleDenotation import Decorators.* import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/core/Comments.scala b/compiler/src/dotty/tools/dotc/core/Comments.scala index b742e3cf8f32..5eab4c119e5e 100644 --- a/compiler/src/dotty/tools/dotc/core/Comments.scala +++ b/compiler/src/dotty/tools/dotc/core/Comments.scala @@ -4,6 +4,7 @@ package core import ast.{ untpd, tpd } import Symbols.*, Contexts.* +import TypeApplications.* import util.{SourceFile, ReadOnlyMap} import util.Spans.* import util.CommentParsing.* diff --git a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala index 5d6169cc6990..97bf2af51083 100644 --- a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -3,6 +3,7 @@ package dotc package core import Types.* +import TypeApplications.* import Contexts.* import Symbols.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala index c33d276cbec0..0fbbb6cec6a4 100644 --- a/compiler/src/dotty/tools/dotc/core/Contexts.scala +++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala @@ -8,6 +8,7 @@ import Periods.* import Names.* import Phases.* import Types.* +import TypeApplications.* import Symbols.* import Scopes.* import Uniques.* diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 372c6994e655..9b3ca1f8a040 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -4,6 +4,7 @@ package core import scala.annotation.{threadUnsafe => tu} import Types.*, Contexts.*, Symbols.*, SymDenotations.*, StdNames.*, Names.*, Phases.* +import TypeApplications.* import Flags.*, Scopes.*, Decorators.*, NameOps.*, Periods.*, NullOpsDecorator.* import unpickleScala2.Scala2Unpickler.ensureConstructor import scala.collection.mutable diff --git a/compiler/src/dotty/tools/dotc/core/NamerOps.scala b/compiler/src/dotty/tools/dotc/core/NamerOps.scala index 0417ae554bef..30fb3d10661d 100644 --- a/compiler/src/dotty/tools/dotc/core/NamerOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NamerOps.scala @@ -3,9 +3,9 @@ package dotc package core import Contexts.*, Symbols.*, Types.*, Flags.*, Scopes.*, Decorators.*, Names.*, NameOps.* +import TypeApplications.* import SymDenotations.{LazyType, SymDenotation}, StdNames.nme import ContextOps.enter -import TypeApplications.EtaExpansion import collection.mutable import config.Printers.typr import rewrites.Rewrites.patch diff --git a/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala b/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala index 9baf0c40a80b..18c46091d01c 100644 --- a/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala +++ b/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala @@ -5,6 +5,7 @@ package core import Decorators.* import Symbols.* import Types.* +import TypeApplications.* import Flags.* import Contexts.ctx import dotty.tools.dotc.reporting.trace diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 3b198ea4dbaa..29aa94d7c0fe 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -4,10 +4,10 @@ package core import Periods.*, Contexts.*, Symbols.*, Denotations.*, Names.*, NameOps.*, Annotations.* import Types.*, Flags.*, Decorators.*, DenotTransformers.*, StdNames.*, Scopes.* +import TypeApplications.* import NameOps.*, NameKinds.* import Phases.{Phase, typerPhase, unfusedPhases} import Constants.Constant -import TypeApplications.TypeParamInfo import Scopes.Scope import dotty.tools.io.AbstractFile import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index f3496a8636dd..5651d0f617db 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -14,6 +14,7 @@ import Denotations.* import printing.Texts.* import printing.Printer import Types.* +import TypeApplications.* import util.Spans.* import DenotTransformers.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index e1d4633e3ca4..7f24a54ea7ad 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -3,6 +3,7 @@ package dotc package core import Types.* +import TypeApplications.* import Contexts.* import Symbols.* import SymDenotations.LazyType @@ -26,7 +27,7 @@ object TypeApplications: * * @param tycon C */ - object EtaExpansion: + object EtaExpansion: // note typer.EtaExpansion /** Test that the parameter bounds in a hk type lambda `[X1,...,Xn] => C[X1, ..., Xn]` * contain the bounds of the type parameters of `C`. This is necessary to be able to @@ -149,11 +150,7 @@ object TypeApplications: } } -/** Extensions that model type application. - */ -trait TypeApplications: - import TypeApplications.* - + // Extensions that model type application. extension (self: Type) { // braces to avoid indent /** The type parameters of this type are: * For a ClassInfo type, the type parameters of its class. @@ -310,7 +307,7 @@ trait TypeApplications: /** Convert a type constructor `TC` which has type parameters `X1, ..., Xn` * to `[X1, ..., Xn] -> TC[X1, ..., Xn]`. */ - def etaExpand(using Context): Type = + def etaExpand(using Context): Type = // note typer.EtaExpansion.etaExpand val tparams = self.typeParams val resType = self.appliedTo(tparams.map(_.paramRef)) self.dealias match diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 77fdc24a01cc..994747fab894 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -3,6 +3,7 @@ package dotc package core import Types.*, Contexts.*, Symbols.*, Flags.*, Names.*, NameOps.*, Denotations.* +import TypeApplications.* import Decorators.* import Phases.{gettersPhase, elimByNamePhase} import StdNames.nme diff --git a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala index c29b971f1a5a..89aea795115b 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala @@ -3,6 +3,7 @@ package dotc package core import Symbols.*, Types.*, Contexts.*, Flags.*, Names.*, StdNames.*, Phases.* +import TypeApplications.* import Flags.JavaDefined import Uniques.unique import backend.sjs.JSDefinitions diff --git a/compiler/src/dotty/tools/dotc/core/TypeEval.scala b/compiler/src/dotty/tools/dotc/core/TypeEval.scala index 98578f353b96..1ace92e7ff04 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeEval.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeEval.scala @@ -3,6 +3,7 @@ package dotc package core import Types.*, Contexts.*, Symbols.*, Constants.*, Decorators.* +import TypeApplications.* import config.Printers.typr import reporting.trace import StdNames.tpnme diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index af449f323558..af97d3291ebb 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -3,6 +3,7 @@ package dotc package core import Contexts.*, Types.*, Symbols.*, Names.*, NameKinds.*, Flags.* +import TypeApplications.* import SymDenotations.* import util.Spans.* import util.Stats diff --git a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala index 594249065d98..6fa139e7fc80 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala @@ -4,6 +4,7 @@ package core import TypeErasure.ErasedValueType import Types.*, Contexts.*, Symbols.*, Flags.*, Decorators.*, SymDenotations.* +import TypeApplications.* import Names.{Name, TermName} import Constants.Constant diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 63f86565a180..7e505d455f7b 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -19,6 +19,7 @@ import Denotations.* import Periods.* import CheckRealizable.* import Variances.{Variance, setStructuralVariances, Invariant} +import TypeApplications.* import typer.Nullables import util.Stats.* import util.{SimpleIdentityMap, SimpleIdentitySet} @@ -2169,11 +2170,7 @@ object Types extends TypeUtils { /** Is the `hash` of this type the same for all possible sequences of enclosing binders? */ def hashIsStable: Boolean = true } - object Type: - // Extensions that model type application. - given TypeApplications() - - // end Type + end Type // ----- Type categories ---------------------------------------------- diff --git a/compiler/src/dotty/tools/dotc/core/Variances.scala b/compiler/src/dotty/tools/dotc/core/Variances.scala index e18a31e46769..392f3de4dbfe 100644 --- a/compiler/src/dotty/tools/dotc/core/Variances.scala +++ b/compiler/src/dotty/tools/dotc/core/Variances.scala @@ -2,7 +2,7 @@ package dotty.tools.dotc package core import Types.*, Contexts.*, Flags.*, Symbols.*, Annotations.* -import TypeApplications.TypeParamInfo +import TypeApplications.* import Decorators.* object Variances { diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index ea8a74d18192..7d4a61d39503 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -8,6 +8,7 @@ import scala.language.unsafeNulls import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler } import Contexts.*, Symbols.*, Types.*, Names.*, StdNames.*, NameOps.*, Scopes.*, Decorators.* +import TypeApplications.* import SymDenotations.*, unpickleScala2.Scala2Unpickler.*, Constants.*, Annotations.*, util.Spans.* import Phases.* import ast.{ tpd, untpd } diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index aa1fbf371fec..9e13f8ceea49 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -9,6 +9,7 @@ import Comments.docCtx import Contexts.* import Symbols.* import Types.* +import TypeApplications.* import Scopes.* import SymDenotations.* import Denotations.* diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index 5087044f73e8..d457dc7a551a 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -10,6 +10,7 @@ import java.lang.Float.intBitsToFloat import java.lang.Double.longBitsToDouble import Contexts.*, Symbols.*, Types.*, Scopes.*, SymDenotations.*, Names.*, NameOps.* +import TypeApplications.* import StdNames.*, Denotations.*, NameOps.*, Flags.*, Constants.*, Annotations.*, Phases.* import NameKinds.{Scala2MethodNameKinds, SuperAccessorName, ExpandedName} import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala index 356e5ad40fdd..dd11f546aac6 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala @@ -4,6 +4,7 @@ package inlines import ast.*, core.* import Flags.*, Symbols.*, Types.*, Decorators.*, Constants.*, Contexts.* +import TypeApplications.* import StdNames.nme import typer.* import Names.Name diff --git a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala index 2dd86132fb97..c03a95f3d6d0 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala @@ -4,6 +4,7 @@ package inlines import ast.*, core.* import Flags.*, Symbols.*, Types.*, Decorators.*, Constants.*, Contexts.* +import TypeApplications.* import StdNames.{tpnme, nme} import NameOps.* import typer.* diff --git a/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala b/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala index 47a47f10f905..a7dc144e335a 100644 --- a/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala +++ b/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala @@ -9,6 +9,7 @@ import Flags.* import Symbols.* import Flags.* import Types.* +import TypeApplications.* import Decorators.* import StdNames.nme import Contexts.* diff --git a/compiler/src/dotty/tools/dotc/interactive/Completion.scala b/compiler/src/dotty/tools/dotc/interactive/Completion.scala index 7b2c5977fdbd..2b399f7dc7c9 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Completion.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Completion.scala @@ -19,6 +19,7 @@ import dotty.tools.dotc.core.SymDenotations.SymDenotation import dotty.tools.dotc.core.TypeError import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Types.{AppliedType, ExprType, MethodOrPoly, NameFilter, NoType, RefinedType, TermRef, Type, TypeProxy} +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.parsing.Tokens import dotty.tools.dotc.typer.Implicits.SearchSuccess import dotty.tools.dotc.typer.Inferencing diff --git a/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala b/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala index c15e6c93bf90..67dd76d85257 100644 --- a/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala @@ -15,6 +15,7 @@ import Contexts.* import Symbols.defn import Names.* import Types.* +import TypeApplications.* import ast.Trees.* import Decorators.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala index 90dfb72ef010..ece5b797f3c2 100644 --- a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -3,6 +3,7 @@ package printing import core.* import Texts.*, Types.*, Flags.*, Names.*, Symbols.*, NameOps.*, Constants.*, Denotations.* +import TypeApplications.* import StdNames.* import Contexts.* import Scopes.Scope, Denotations.Denotation, Annotations.Annotation diff --git a/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala b/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala index 1ec54577da23..213d09c41b92 100644 --- a/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala +++ b/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala @@ -17,6 +17,7 @@ import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.TypeOps.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.reporting.IllegalVariableInPatternAlternative diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala index c281cbab544e..bbe0cfc12cc4 100644 --- a/compiler/src/dotty/tools/dotc/reporting/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala @@ -5,6 +5,7 @@ package reporting import core.* import Contexts.* import Decorators.*, Symbols.*, Names.*, NameOps.*, Types.*, Flags.*, Phases.* +import TypeApplications.* import Denotations.SingleDenotation import SymDenotations.SymDenotation import NameKinds.{WildcardParamName, ContextFunctionParamName} diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index 41a586b46b43..f2237a65266e 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -13,6 +13,7 @@ import Flags.* import Phases.* import Trees.* import Types.* +import TypeApplications.* import Symbols.* import Names.* import StdNames.str diff --git a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala index 3f156e5a7b40..eeca23adc591 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala @@ -5,6 +5,7 @@ package semanticdb import core.Symbols.* import core.Contexts.Context import core.Types.* +import core.TypeApplications.* import core.Annotations.Annotation import core.Flags import core.Names.Name diff --git a/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala b/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala index b958b64f7c54..cf9eee846d56 100644 --- a/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala +++ b/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala @@ -10,6 +10,7 @@ import dotty.tools.dotc.core.NameKinds.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.quoted.QuotePatterns import dotty.tools.dotc.staging.QuoteTypeTags.* import dotty.tools.dotc.staging.StagingLevel.* diff --git a/compiler/src/dotty/tools/dotc/staging/HealType.scala b/compiler/src/dotty/tools/dotc/staging/HealType.scala index 509049e131c8..cc7d4c3d86c2 100644 --- a/compiler/src/dotty/tools/dotc/staging/HealType.scala +++ b/compiler/src/dotty/tools/dotc/staging/HealType.scala @@ -9,6 +9,7 @@ import core.Flags.* import core.StdNames.* import core.Symbols.* import core.Types.* +import core.TypeApplications.* import StagingLevel.* import QuoteTypeTags.* diff --git a/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala b/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala index cbf3437cdaad..d1c9077bf182 100644 --- a/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala +++ b/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala @@ -10,6 +10,7 @@ import Names.* import NameOps.* import Decorators.* import Types.* +import TypeApplications.* import util.Spans.Span import config.Printers.transforms import Annotations.ExperimentalAnnotation diff --git a/compiler/src/dotty/tools/dotc/transform/Bridges.scala b/compiler/src/dotty/tools/dotc/transform/Bridges.scala index 482e5056fad0..68266e6b960c 100644 --- a/compiler/src/dotty/tools/dotc/transform/Bridges.scala +++ b/compiler/src/dotty/tools/dotc/transform/Bridges.scala @@ -4,6 +4,7 @@ package transform import core.* import Symbols.*, Types.*, Contexts.*, Decorators.*, Flags.*, Scopes.*, Phases.* +import TypeApplications.* import DenotTransformers.* import ast.untpd import collection.{mutable, immutable} diff --git a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala index 2bf164f4b2a3..931cbad100be 100644 --- a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala +++ b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala @@ -11,6 +11,7 @@ import core.StdNames.nme import core.Names.* import core.NameKinds.TempResultName import core.Constants.* +import core.TypeApplications.* import util.Store import dotty.tools.uncheckedNN import ast.tpd.* diff --git a/compiler/src/dotty/tools/dotc/transform/Constructors.scala b/compiler/src/dotty/tools/dotc/transform/Constructors.scala index b373565489f0..d872c44d83cb 100644 --- a/compiler/src/dotty/tools/dotc/transform/Constructors.scala +++ b/compiler/src/dotty/tools/dotc/transform/Constructors.scala @@ -16,6 +16,7 @@ import Decorators.* import DenotTransformers.* import collection.mutable import Types.* +import TypeApplications.* object Constructors { val name: String = "constructors" diff --git a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala index 0bf2dc107ce9..63e91175ee93 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala @@ -6,6 +6,7 @@ import core.* import Contexts.* import Symbols.* import Types.* +import TypeApplications.* import Flags.* import SymDenotations.* import DenotTransformers.InfoTransformer diff --git a/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala b/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala index ae2fc578728f..084dec866add 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala @@ -5,6 +5,7 @@ package transform import core.* import StdNames.nme import Types.* +import TypeApplications.* import transform.MegaPhase.* import Flags.* import Contexts.* diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala index 9a8f5596471f..5c7b77c71117 100644 --- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala +++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala @@ -10,6 +10,7 @@ import core.SymDenotations.* import core.Symbols.* import core.Contexts.* import core.Types.* +import core.TypeApplications.* import core.Names.* import core.StdNames.* import core.NameOps.* diff --git a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala index f76419f5198e..4dcf417041d3 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala @@ -5,6 +5,7 @@ package transform import core.* import Scopes.newScope import Contexts.*, Symbols.*, Types.*, Flags.*, Decorators.*, StdNames.*, Constants.* +import TypeApplications.* import MegaPhase.* import Names.TypeName diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala index c1b3c5a6493d..22da139425dd 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -8,6 +8,7 @@ import core.Symbols.* import core.Contexts.* import core.Phases.* import core.Types.* +import core.TypeApplications.* import core.Flags.* import core.Decorators.* import core.StdNames.nme diff --git a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala index 81cc73c26ed6..b30b66224595 100644 --- a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala +++ b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala @@ -7,6 +7,7 @@ import dotty.tools.dotc.transform.MegaPhase.* import ast.untpd import Flags.* import Types.* +import TypeApplications.* import Constants.Constant import Contexts.* import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala index 35797922482d..6f68182a679f 100644 --- a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala +++ b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala @@ -3,6 +3,7 @@ package transform import core.* import Types.* +import TypeApplications.* import Contexts.* import Symbols.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala b/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala index 4cf176cfda3a..97aefba57b7b 100644 --- a/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala +++ b/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala @@ -11,6 +11,7 @@ import StdNames.* import Symbols.* import MegaPhase.* import Types.* +import TypeApplications.* /** This phase adds forwarder for XXL functions `apply` methods that are implemented with a method diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index a882ed8f41c2..b6625a6527c8 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -13,6 +13,7 @@ import core.Symbols.* import core.TypeApplications.{EtaExpansion, TypeParamInfo} import core.TypeErasure.{erasedGlb, erasure, fullErasure, isGenericArrayElement, tupleArity} import core.Types.* +import core.TypeApplications.* import core.classfile.ClassfileConstants import config.Printers.transforms diff --git a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala index 96cffeb1097d..ca7358b46e0c 100644 --- a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala +++ b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala @@ -7,6 +7,7 @@ import core.Symbols.* import core.Contexts.* import ast.TreeTypeMap import core.Types.* +import core.TypeApplications.* import core.Flags.* import core.Decorators.* import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala b/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala index 449402f17fce..5685298da17a 100644 --- a/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala +++ b/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala @@ -13,6 +13,7 @@ import core.Constants.Constant import core.NameOps.isContextFunction import core.StdNames.nme import core.Types.* +import core.TypeApplications.* import core.Decorators.* import coverage.* import typer.LiftCoverage diff --git a/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala b/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala index 9f99e7a6fbd3..2654a17f7772 100644 --- a/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala +++ b/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala @@ -6,6 +6,7 @@ import core.* import Contexts.* import Symbols.* import Flags.* +import TypeApplications.* import Decorators.* import MegaPhase.* diff --git a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala index c2fdccc2861e..f7a9417b5b20 100644 --- a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala @@ -8,6 +8,7 @@ import dotty.tools.dotc.core.Names.TermName import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.transform.MegaPhase.MiniPhase object InterceptedMethods { diff --git a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala index db3157f6130d..8283b1759f45 100644 --- a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala +++ b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala @@ -13,6 +13,7 @@ import core.NameKinds.{ExpandedName, LazyBitMapName, LazyLocalInitName, LazyLoca import core.StdNames.nme import core.Symbols.* import core.Types.* +import core.TypeApplications.* import core.{Names, StdNames} import dotty.tools.dotc.config.Feature import transform.MegaPhase.MiniPhase diff --git a/compiler/src/dotty/tools/dotc/transform/Memoize.scala b/compiler/src/dotty/tools/dotc/transform/Memoize.scala index 0b4d4c7dbf59..5b078066dfac 100644 --- a/compiler/src/dotty/tools/dotc/transform/Memoize.scala +++ b/compiler/src/dotty/tools/dotc/transform/Memoize.scala @@ -8,6 +8,7 @@ import Phases.* import SymDenotations.SymDenotation import Denotations.* import Symbols.* +import TypeApplications.* import Constants.* import MegaPhase.* diff --git a/compiler/src/dotty/tools/dotc/transform/Mixin.scala b/compiler/src/dotty/tools/dotc/transform/Mixin.scala index a9813ec90b1a..cdeb027eabfb 100644 --- a/compiler/src/dotty/tools/dotc/transform/Mixin.scala +++ b/compiler/src/dotty/tools/dotc/transform/Mixin.scala @@ -10,6 +10,7 @@ import Flags.* import Symbols.* import SymDenotations.* import Types.* +import TypeApplications.* import Decorators.* import DenotTransformers.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/transform/MixinOps.scala b/compiler/src/dotty/tools/dotc/transform/MixinOps.scala index 3a3fa65ff64b..d0725f05ca95 100644 --- a/compiler/src/dotty/tools/dotc/transform/MixinOps.scala +++ b/compiler/src/dotty/tools/dotc/transform/MixinOps.scala @@ -4,6 +4,7 @@ package transform import core.* import Symbols.*, Types.*, Contexts.*, DenotTransformers.*, Flags.* import NameKinds.* +import TypeApplications.* import util.Spans.* import StdNames.*, NameOps.* diff --git a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala index 6ff81ab13cf1..b2f668b2d490 100644 --- a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala +++ b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala @@ -3,6 +3,7 @@ package transform import core.* import Contexts.*, Symbols.*, Types.*, Flags.*, StdNames.* +import TypeApplications.* import MegaPhase.* import NameKinds.NonLocalReturnKeyName import config.SourceVersion.* diff --git a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala index 16c50b9cd474..75b7fb0d9297 100644 --- a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala +++ b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala @@ -4,6 +4,7 @@ package transform import core.* import Flags.*, Symbols.*, Contexts.*, Scopes.*, Decorators.*, Types.Type +import TypeApplications.* import NameKinds.DefaultGetterName import NullOpsDecorator.* import collection.immutable.BitSet diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala index 273879f3c3cb..5c9b52cad862 100644 --- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -5,6 +5,7 @@ package transform import core.* import MegaPhase.* import Symbols.*, Contexts.*, Types.*, StdNames.*, NameOps.* +import TypeApplications.* import patmat.SpaceEngine import util.Spans.* import typer.Applications.* diff --git a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala index d9a1ea9ad9af..ff60467e2975 100644 --- a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala +++ b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala @@ -5,6 +5,7 @@ import core.* import Decorators.* import Flags.* import Types.* +import TypeApplications.* import Contexts.* import Symbols.* import Constants.* diff --git a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala index 29baf816da5e..2c443e6faae7 100644 --- a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala +++ b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala @@ -10,6 +10,7 @@ import dotty.tools.dotc.inlines.Inlines import dotty.tools.dotc.typer.VarianceChecker import typer.ErrorReporting.errorTree import Types.*, Contexts.*, Names.*, Flags.*, DenotTransformers.*, Phases.* +import TypeApplications.* import SymDenotations.*, StdNames.*, Annotations.*, Trees.*, Scopes.* import Decorators.* import Symbols.*, NameOps.* diff --git a/compiler/src/dotty/tools/dotc/transform/Recheck.scala b/compiler/src/dotty/tools/dotc/transform/Recheck.scala index 6a12e3ccf3b6..e5d4925bb803 100644 --- a/compiler/src/dotty/tools/dotc/transform/Recheck.scala +++ b/compiler/src/dotty/tools/dotc/transform/Recheck.scala @@ -4,6 +4,7 @@ package transform import core.* import Symbols.*, Contexts.*, Types.*, ContextOps.*, Decorators.*, SymDenotations.* +import TypeApplications.* import Flags.*, NameKinds.*, Denotations.{Denotation, SingleDenotation} import ast.* import Names.Name diff --git a/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala b/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala index f1603db0e5a0..fa6913c3dc0e 100644 --- a/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala +++ b/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala @@ -5,6 +5,7 @@ import core.* import Decorators.* import Flags.* import Types.* +import TypeApplications.* import Contexts.* import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala index a7c9b679d65e..3015c4922aa2 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala @@ -3,6 +3,7 @@ package transform import ast.Trees.*, ast.tpd, core.* import Contexts.*, Types.*, Decorators.*, Symbols.*, DenotTransformers.* +import TypeApplications.* import SymDenotations.*, Scopes.*, StdNames.*, NameOps.*, Names.* import MegaPhase.MiniPhase import config.Feature diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala index 007ea3112c09..2c35e8bfe6ce 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala @@ -3,6 +3,7 @@ package transform import ast.Trees.*, ast.tpd, core.* import Contexts.*, Types.*, Decorators.*, Symbols.*, DenotTransformers.* +import TypeApplications.* import SymDenotations.*, Scopes.*, StdNames.*, NameOps.*, Names.*, NameKinds.* import MegaPhase.MiniPhase diff --git a/compiler/src/dotty/tools/dotc/transform/Splicing.scala b/compiler/src/dotty/tools/dotc/transform/Splicing.scala index 967c1cb6d19b..7dc2bc38fa8e 100644 --- a/compiler/src/dotty/tools/dotc/transform/Splicing.scala +++ b/compiler/src/dotty/tools/dotc/transform/Splicing.scala @@ -5,6 +5,7 @@ import core.* import Decorators.* import Flags.* import Types.* +import TypeApplications.* import Contexts.* import Symbols.* import Constants.* diff --git a/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala b/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala index f54e69d971f8..68f79bc8f27b 100644 --- a/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala +++ b/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala @@ -3,6 +3,7 @@ package transform import core.* import Symbols.*, Types.*, Contexts.*, Names.*, StdNames.*, Constants.* +import TypeApplications.* import Flags.* import DenotTransformers.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index d9c6da8d97eb..266d95d3130d 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -9,6 +9,7 @@ import core.SymDenotations.* import core.Contexts.* import core.Symbols.* import core.Types.* +import core.TypeApplications.* import core.Flags.* import core.StdNames.* import core.NameKinds.{DocArtifactName, OuterSelectName} @@ -894,4 +895,4 @@ object TreeChecker { case _ => Nil } -} \ No newline at end of file +} diff --git a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala index bdb7072a6530..c96988e21403 100644 --- a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala +++ b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala @@ -10,6 +10,7 @@ import StdNames.* import Symbols.* import MegaPhase.* import Types.* +import TypeApplications.* import dotty.tools.dotc.ast.tpd /** Optimize generic operations on tuples */ diff --git a/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index a8c8ec8ce1d8..fb0eaaf9da00 100644 --- a/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala +++ b/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala @@ -6,6 +6,7 @@ import scala.language.unsafeNulls as _ import core.* import Contexts.*, Symbols.*, Types.*, Constants.*, StdNames.*, Decorators.* +import TypeApplications.* import ast.untpd import Erasure.Boxing.* import TypeErasure.* diff --git a/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala b/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala index bf9e20e68930..d08eb73f20eb 100644 --- a/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala +++ b/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala @@ -15,6 +15,7 @@ import Names.* import dotty.tools.dotc.core.NameKinds.DefaultGetterName import dotty.tools.dotc.core.Types.{MethodType, NamedType, PolyType, Type, NoPrefix, NoType} +import TypeApplications.* import dotty.tools.dotc.printing.Formatting.hl diff --git a/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala b/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala index 55b26d89b5a0..0b789330332c 100644 --- a/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala @@ -5,6 +5,7 @@ package transform import ast.{Trees, tpd} import core.* import Contexts.*, Trees.*, Types.* +import TypeApplications.* import DenotTransformers.*, MegaPhase.* import ExtensionMethods.*, ValueClasses.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala index 474ec4de7962..a720f349e0a3 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala @@ -6,6 +6,7 @@ import core.* import Contexts.* import Symbols.* import Types.* +import TypeApplications.* import Denotations.Denotation import StdNames.* import Names.TermName diff --git a/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala b/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala index db3a0c6c71f2..0e02ddc57266 100644 --- a/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala +++ b/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala @@ -12,6 +12,7 @@ import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.printing.Formatting.* import dotty.tools.dotc.reporting.BadFormatInterpolation +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.transform.MegaPhase.MiniPhase import dotty.tools.dotc.typer.ConstFold diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index 8ede7ba831f5..fbc75efa300c 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -5,6 +5,7 @@ package patmat import core.* import Constants.*, Contexts.*, Decorators.*, Flags.*, NullOpsDecorator.*, Symbols.*, Types.* +import TypeApplications.* import Names.*, NameOps.*, StdNames.* import ast.*, tpd.* import config.Printers.exhaustivity diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala b/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala index 951024f3d4db..aa5590a760bf 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala @@ -9,6 +9,7 @@ import core.Contexts.* import core.Decorators.* import core.StdNames.nme import core.Symbols.* +import core.TypeApplications.* import dotty.tools.backend.sjs.JSDefinitions.jsdefn diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala b/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala index 5c7119860ae4..27bfcd5c867f 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala @@ -13,6 +13,7 @@ import core.DenotTransformers.* import core.Symbols.* import core.Contexts.* import core.Types.* +import core.TypeApplications.* import core.Flags.* import core.Decorators.* import core.StdNames.nme diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala b/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala index b7a179ac7562..028964104977 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala @@ -13,6 +13,7 @@ import Scopes.* import Symbols.* import StdNames.* import Types.* +import TypeApplications.* import Decorators.em import dotty.tools.dotc.transform.MegaPhase.* diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala index 43b29a224564..a32d7b9e67a5 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala @@ -13,6 +13,7 @@ import StdNames.* import Symbols.* import Types.* +import TypeApplications.* import util.Spans.Span import util.SrcPos diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala index 77950d21ab58..de49ec4f5481 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala @@ -20,6 +20,7 @@ import StdNames.* import Symbols.* import Types.* +import TypeApplications.* import JSSymUtils.* diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 5944a586d1cf..299a4ea7d3cd 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -11,6 +11,7 @@ import Flags.* import Symbols.* import Denotations.Denotation import Types.* +import TypeApplications.* import Decorators.* import ErrorReporting.* import Trees.* @@ -29,7 +30,6 @@ import util.chaining.tap import collection.mutable import config.Printers.{overload, typr, unapp} -import TypeApplications.* import Annotations.Annotation import Constants.{Constant, IntTag} diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 7f52c871f9de..a71189f62eac 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -6,6 +6,7 @@ import core.* import ast.* import Contexts.* import Types.* +import TypeApplications.* import Flags.* import Names.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/typer/Deriving.scala b/compiler/src/dotty/tools/dotc/typer/Deriving.scala index ef77adf18626..180202a0f818 100644 --- a/compiler/src/dotty/tools/dotc/typer/Deriving.scala +++ b/compiler/src/dotty/tools/dotc/typer/Deriving.scala @@ -7,6 +7,7 @@ import ast.* import ast.Trees.* import StdNames.* import Contexts.*, Symbols.*, Types.*, SymDenotations.*, Names.*, NameOps.*, Flags.*, Decorators.* +import TypeApplications.* import ProtoTypes.*, ContextOps.* import util.Spans.* import util.SrcPos diff --git a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala index 683244cc8795..da27a24d4d27 100644 --- a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala +++ b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala @@ -12,6 +12,7 @@ import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.Names.{Name, TermName} import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.TypeErasure import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala index 3fb02026f7aa..3ba61aa671cf 100644 --- a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala +++ b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala @@ -6,6 +6,7 @@ import core.* import ast.{Trees, untpd, tpd} import Contexts.* import Types.* +import TypeApplications.* import Flags.* import Symbols.* import Names.* diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index d3e3a0d06bd8..b8bcc52b58d5 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -11,6 +11,7 @@ import printing.{Showable, Printer} import printing.Texts.* import Contexts.* import Types.* +import TypeApplications.* import Flags.* import Mode.ImplicitsEnabled import NameKinds.{LazyImplicitName, ContextBoundParamName} diff --git a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala index b7861c236b73..9cb3bdde44b7 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala @@ -5,6 +5,7 @@ package typer import core.* import ast.* import Contexts.*, Types.*, Flags.*, Symbols.* +import TypeApplications.* import ProtoTypes.* import NameKinds.UniqueName import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 02a55be9ea5a..7938308142d5 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -6,6 +6,7 @@ import core.* import ast.* import Trees.*, StdNames.*, Scopes.*, Denotations.*, NamerOps.*, ContextOps.* import Contexts.*, Symbols.*, Types.*, SymDenotations.*, Names.*, NameOps.*, Flags.* +import TypeApplications.* import Decorators.*, Comments.{_, given} import NameKinds.DefaultGetterName import ast.desugar, ast.desugar.* diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala index 4fc092d16007..4b1f4a7291cb 100644 --- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -5,6 +5,7 @@ package typer import core.* import ast.* import Contexts.*, Types.*, Denotations.*, Names.*, StdNames.*, NameOps.*, Symbols.* +import TypeApplications.* import NameKinds.DepParamName import Trees.* import Constants.* diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index f979654e9811..fe7bb247e4f3 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -14,6 +14,7 @@ import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.inlines.PrepareInlineable import dotty.tools.dotc.quoted.QuotePatterns import dotty.tools.dotc.staging.StagingLevel.* diff --git a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala index 8400639706d6..bd90cf5361d2 100644 --- a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala +++ b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala @@ -4,6 +4,7 @@ package typer import core.* import Contexts.* import Types.* +import TypeApplications.* import Symbols.* import StdNames.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 1006044e851d..26aad6bebb93 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -5,6 +5,7 @@ package typer import transform.* import core.* import Symbols.*, Types.*, Contexts.*, Flags.*, Names.*, NameOps.*, NameKinds.* +import TypeApplications.* import StdNames.*, Denotations.*, Phases.*, SymDenotations.* import NameKinds.DefaultGetterName import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala index 3b114de6a05c..a08dd1fca7c8 100644 --- a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala @@ -6,6 +6,7 @@ import core.* import util.Spans.Span import Contexts.* import Types.*, Flags.*, Symbols.*, Names.*, StdNames.*, Constants.* +import TypeApplications.* import TypeErasure.{erasure, hasStableErasure} import Decorators.* import ProtoTypes.* diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala index 55b6384c9e89..a06729066a91 100644 --- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -6,6 +6,7 @@ import core.* import ast.* import Contexts.*, ContextOps.*, Constants.*, Types.*, Symbols.*, Names.*, Flags.*, Decorators.* import ErrorReporting.*, Annotations.*, Denotations.*, SymDenotations.*, StdNames.* +import TypeApplications.* import util.SrcPos import NameOps.* import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 7432a0900ac5..97e35924db18 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -14,6 +14,7 @@ import ProtoTypes.* import Contexts.* import Symbols.* import Types.* +import TypeApplications.* import SymDenotations.* import Annotations.* import Names.* @@ -27,7 +28,7 @@ import ErrorReporting.* import Checking.* import Inferencing.* import Dynamic.isDynamicExpansion -import EtaExpansion.etaExpand +import typer.EtaExpansion.etaExpand import TypeComparer.CompareResult import inlines.{Inlines, PrepareInlineable} import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala b/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala index 354f09382d82..140d4fd0973d 100644 --- a/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala +++ b/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala @@ -4,6 +4,7 @@ package typer import dotty.tools.dotc.ast.{ Trees, tpd } import core.* import Types.*, Contexts.*, Flags.*, Symbols.*, Trees.* +import TypeApplications.* import Decorators.* import Variances.* import NameKinds.* diff --git a/compiler/src/dotty/tools/dotc/util/Signatures.scala b/compiler/src/dotty/tools/dotc/util/Signatures.scala index 3b45d8f2fa51..0d4405a8191f 100644 --- a/compiler/src/dotty/tools/dotc/util/Signatures.scala +++ b/compiler/src/dotty/tools/dotc/util/Signatures.scala @@ -16,6 +16,7 @@ import core.Flags import core.Names.* import core.NameKinds import core.Types.* +import core.TypeApplications.* import core.Symbols.{NoSymbol, isLocalToBlock} import interactive.Interactive import util.Spans.Span diff --git a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala index e4a17e04a7d1..29453335e20e 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala @@ -8,6 +8,7 @@ import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.Mode.GadtConstraintInference import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.util.optional diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 4cc4d4e99e3f..5bd32b3cd981 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -14,6 +14,7 @@ import dotty.tools.dotc.core.NameOps.* import dotty.tools.dotc.core.Scopes.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types +import dotty.tools.dotc.core.TypeApplications, TypeApplications.* import dotty.tools.dotc.NoCompilationUnit import dotty.tools.dotc.quoted.MacroExpansion import dotty.tools.dotc.quoted.PickledQuotes @@ -1911,9 +1912,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler dotc.core.Symbols.defn.isTupleNType(self) def select(sym: Symbol): TypeRepr = self.select(sym) def appliedTo(targ: TypeRepr): TypeRepr = - Types.Type.given_TypeApplications.appliedTo(self)(targ) + TypeApplications.appliedTo(self)(targ) def appliedTo(targs: List[TypeRepr]): TypeRepr = - Types.Type.given_TypeApplications.appliedTo(self)(targs) + TypeApplications.appliedTo(self)(targs) def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr = self.subst(from, to) diff --git a/compiler/test/dotty/tools/AnnotationsTests.scala b/compiler/test/dotty/tools/AnnotationsTests.scala index 3998bf7c93c0..aa5f9a94373b 100644 --- a/compiler/test/dotty/tools/AnnotationsTests.scala +++ b/compiler/test/dotty/tools/AnnotationsTests.scala @@ -10,6 +10,7 @@ import dotc.core.Contexts._ import dotc.core.Phases._ import dotc.core.Types._ import dotc.core.Symbols._ +import dotc.core.TypeApplications.* import java.io.File import java.nio.file._ diff --git a/compiler/test/dotty/tools/SignatureTest.scala b/compiler/test/dotty/tools/SignatureTest.scala index 587d7098a0a7..d67a53657423 100644 --- a/compiler/test/dotty/tools/SignatureTest.scala +++ b/compiler/test/dotty/tools/SignatureTest.scala @@ -12,6 +12,7 @@ import dotc.core.Flags._ import dotc.core.Phases._ import dotc.core.Names._ import dotc.core.Types._ +import dotc.core.TypeApplications.* import dotc.core.Symbols._ import dotc.core.StdNames._ import dotc.core.Signature diff --git a/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala b/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala index d7b2fd6a5173..4843d5b87a10 100644 --- a/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala +++ b/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala @@ -4,6 +4,7 @@ package transform package patmat import core.*, Annotations.*, Contexts.*, Decorators.*, Flags.*, Names.*, StdNames.*, Symbols.*, Types.* +import TypeApplications.* import ast.*, tpd.* import vulpix.TestConfiguration, TestConfiguration.basicClasspath diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala index 05d97972d76e..3ba9333048e1 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala @@ -9,6 +9,7 @@ import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.Symbols.Symbol import dotty.tools.dotc.core.Types.Type +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.pc.printer.ShortenedTypePrinter import dotty.tools.pc.utils.InteractiveEnrichments.decoded diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala index 72b65b3cadb9..9604bbac2082 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala @@ -25,6 +25,7 @@ import dotty.tools.dotc.core.StdNames import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.interactive.Completion import dotty.tools.dotc.interactive.Completion.Mode import dotty.tools.dotc.util.SourcePosition diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala index 2e89b4e5bb99..76cfaf76dc3e 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala @@ -28,6 +28,7 @@ import dotty.tools.dotc.core.Types.OrType import dotty.tools.dotc.core.Types.Type import dotty.tools.dotc.core.Types.TypeRef import dotty.tools.dotc.core.Types.AppliedType +import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.typer.Applications.UnapplyArgs import dotty.tools.dotc.util.SourcePosition import dotty.tools.pc.AutoImports.AutoImportsGenerator From 9da0674a05ca75c79f76eca741e6ec2801adf79f Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Wed, 23 Jul 2025 09:43:00 -0700 Subject: [PATCH 4/5] Revert "Switch TypeApplications to extensions for import" This reverts commit 9b02d6a2e57d6c1c8d0d7710ebbd93fea78371ff. --- .../dotty/tools/backend/jvm/BCodeBodyBuilder.scala | 1 - .../dotty/tools/backend/jvm/BCodeSkelBuilder.scala | 1 - .../src/dotty/tools/debug/ExtractExpression.scala | 1 - .../src/dotty/tools/debug/ResolveReflectEval.scala | 1 - compiler/src/dotty/tools/dotc/ast/Desugar.scala | 1 - compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala | 1 - compiler/src/dotty/tools/dotc/ast/MainProxies.scala | 1 - compiler/src/dotty/tools/dotc/ast/TreeInfo.scala | 1 - compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala | 1 - compiler/src/dotty/tools/dotc/ast/Trees.scala | 1 - compiler/src/dotty/tools/dotc/ast/tpd.scala | 1 - compiler/src/dotty/tools/dotc/ast/untpd.scala | 1 - compiler/src/dotty/tools/dotc/cc/CaptureSet.scala | 1 - compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala | 1 - compiler/src/dotty/tools/dotc/cc/Setup.scala | 1 - compiler/src/dotty/tools/dotc/core/Annotations.scala | 1 - .../src/dotty/tools/dotc/core/CheckRealizable.scala | 1 - compiler/src/dotty/tools/dotc/core/Comments.scala | 1 - .../dotty/tools/dotc/core/ConstraintHandling.scala | 1 - compiler/src/dotty/tools/dotc/core/Contexts.scala | 1 - compiler/src/dotty/tools/dotc/core/Definitions.scala | 1 - compiler/src/dotty/tools/dotc/core/NamerOps.scala | 2 +- .../tools/dotc/core/PatternTypeConstrainer.scala | 1 - .../src/dotty/tools/dotc/core/SymDenotations.scala | 2 +- compiler/src/dotty/tools/dotc/core/Symbols.scala | 1 - .../src/dotty/tools/dotc/core/TypeApplications.scala | 11 +++++++---- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 1 - compiler/src/dotty/tools/dotc/core/TypeErasure.scala | 1 - compiler/src/dotty/tools/dotc/core/TypeEval.scala | 1 - compiler/src/dotty/tools/dotc/core/TypeOps.scala | 1 - compiler/src/dotty/tools/dotc/core/TypeUtils.scala | 1 - compiler/src/dotty/tools/dotc/core/Types.scala | 7 +++++-- compiler/src/dotty/tools/dotc/core/Variances.scala | 2 +- .../tools/dotc/core/classfile/ClassfileParser.scala | 1 - .../dotty/tools/dotc/core/tasty/TreeUnpickler.scala | 1 - .../dotc/core/unpickleScala2/Scala2Unpickler.scala | 1 - compiler/src/dotty/tools/dotc/inlines/Inliner.scala | 1 - compiler/src/dotty/tools/dotc/inlines/Inlines.scala | 1 - .../dotty/tools/dotc/inlines/PrepareInlineable.scala | 1 - .../src/dotty/tools/dotc/interactive/Completion.scala | 1 - .../src/dotty/tools/dotc/parsing/JavaParsers.scala | 1 - .../src/dotty/tools/dotc/printing/PlainPrinter.scala | 1 - .../src/dotty/tools/dotc/quoted/QuotePatterns.scala | 1 - .../src/dotty/tools/dotc/reporting/messages.scala | 1 - compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala | 1 - .../src/dotty/tools/dotc/semanticdb/TypeOps.scala | 1 - .../dotty/tools/dotc/staging/CrossStageSafety.scala | 1 - compiler/src/dotty/tools/dotc/staging/HealType.scala | 1 - .../dotty/tools/dotc/transform/AccessProxies.scala | 1 - compiler/src/dotty/tools/dotc/transform/Bridges.scala | 1 - .../src/dotty/tools/dotc/transform/CapturedVars.scala | 1 - .../src/dotty/tools/dotc/transform/Constructors.scala | 1 - .../src/dotty/tools/dotc/transform/ElimByName.scala | 1 - .../src/dotty/tools/dotc/transform/ElimRepeated.scala | 1 - compiler/src/dotty/tools/dotc/transform/Erasure.scala | 1 - .../src/dotty/tools/dotc/transform/ExpandSAMs.scala | 1 - .../dotty/tools/dotc/transform/ExplicitOuter.scala | 1 - .../dotty/tools/dotc/transform/FirstTransform.scala | 1 - .../tools/dotc/transform/FullParameterization.scala | 1 - .../tools/dotc/transform/FunctionXXLForwarders.scala | 1 - .../tools/dotc/transform/GenericSignatures.scala | 1 - .../dotty/tools/dotc/transform/HoistSuperArgs.scala | 1 - .../tools/dotc/transform/InstrumentCoverage.scala | 1 - .../dotty/tools/dotc/transform/Instrumentation.scala | 1 - .../tools/dotc/transform/InterceptedMethods.scala | 1 - .../src/dotty/tools/dotc/transform/LazyVals.scala | 1 - compiler/src/dotty/tools/dotc/transform/Memoize.scala | 1 - compiler/src/dotty/tools/dotc/transform/Mixin.scala | 1 - .../dotty/tools/dotc/transform/NonLocalReturns.scala | 1 - .../dotty/tools/dotc/transform/OverridingPairs.scala | 1 - .../dotty/tools/dotc/transform/PatternMatcher.scala | 1 - .../src/dotty/tools/dotc/transform/PickleQuotes.scala | 1 - .../src/dotty/tools/dotc/transform/PostTyper.scala | 1 - compiler/src/dotty/tools/dotc/transform/Recheck.scala | 1 - .../dotty/tools/dotc/transform/ReifiedReflect.scala | 1 - .../tools/dotc/transform/SpecializeApplyMethods.scala | 1 - .../tools/dotc/transform/SpecializeFunctions.scala | 1 - .../src/dotty/tools/dotc/transform/Splicing.scala | 1 - .../dotty/tools/dotc/transform/SyntheticMembers.scala | 1 - .../src/dotty/tools/dotc/transform/TreeChecker.scala | 3 +-- .../tools/dotc/transform/TupleOptimizations.scala | 1 - .../dotty/tools/dotc/transform/TypeTestsCasts.scala | 1 - .../tools/dotc/transform/UnrollDefinitions.scala | 1 - .../dotty/tools/dotc/transform/VCInlineMethods.scala | 1 - .../src/dotty/tools/dotc/transform/init/Objects.scala | 1 - .../src/dotty/tools/dotc/transform/patmat/Space.scala | 1 - .../tools/dotc/transform/sjs/AddLocalJSFakeNews.scala | 1 - .../tools/dotc/transform/sjs/ExplicitJSClasses.scala | 1 - .../tools/dotc/transform/sjs/JUnitBootstrappers.scala | 1 - .../tools/dotc/transform/sjs/PrepJSExports.scala | 1 - .../tools/dotc/transform/sjs/PrepJSInterop.scala | 1 - .../src/dotty/tools/dotc/typer/Applications.scala | 2 +- compiler/src/dotty/tools/dotc/typer/Checking.scala | 1 - compiler/src/dotty/tools/dotc/typer/Deriving.scala | 1 - compiler/src/dotty/tools/dotc/typer/Dynamic.scala | 1 - .../src/dotty/tools/dotc/typer/EtaExpansion.scala | 1 - compiler/src/dotty/tools/dotc/typer/Implicits.scala | 1 - compiler/src/dotty/tools/dotc/typer/Inferencing.scala | 1 - compiler/src/dotty/tools/dotc/typer/Namer.scala | 1 - compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala | 1 - .../src/dotty/tools/dotc/typer/QuotesAndSplices.scala | 1 - compiler/src/dotty/tools/dotc/typer/ReTyper.scala | 1 - compiler/src/dotty/tools/dotc/typer/RefChecks.scala | 1 - compiler/src/dotty/tools/dotc/typer/Synthesizer.scala | 1 - .../src/dotty/tools/dotc/typer/TypeAssigner.scala | 1 - compiler/src/dotty/tools/dotc/typer/Typer.scala | 3 +-- .../src/dotty/tools/dotc/typer/VarianceChecker.scala | 1 - compiler/src/dotty/tools/dotc/util/Signatures.scala | 1 - .../src/scala/quoted/runtime/impl/QuoteMatcher.scala | 1 - .../src/scala/quoted/runtime/impl/QuotesImpl.scala | 5 ++--- compiler/test/dotty/tools/AnnotationsTests.scala | 1 - compiler/test/dotty/tools/SignatureTest.scala | 1 - .../tools/dotc/transform/patmat/SpaceEngineTest.scala | 1 - .../dotty/tools/pc/completions/CompletionValue.scala | 1 - .../main/dotty/tools/pc/completions/Completions.scala | 1 - .../tools/pc/completions/MatchCaseCompletions.scala | 1 - 116 files changed, 20 insertions(+), 124 deletions(-) diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala index 203c3ce839a4..41f295d11ef1 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala @@ -16,7 +16,6 @@ import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.core.Constants.* import dotty.tools.dotc.core.Flags.{Label => LabelFlag, _} import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.StdNames.{nme, str} import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.transform.Erasure diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala index 6b02be08f0c5..f8185098390a 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala @@ -17,7 +17,6 @@ import dotty.tools.dotc.core.NameKinds.* import dotty.tools.dotc.core.Names.TermName import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.util.Spans.* import dotty.tools.dotc.report diff --git a/compiler/src/dotty/tools/debug/ExtractExpression.scala b/compiler/src/dotty/tools/debug/ExtractExpression.scala index 7670069b170f..151d75270c6e 100644 --- a/compiler/src/dotty/tools/debug/ExtractExpression.scala +++ b/compiler/src/dotty/tools/debug/ExtractExpression.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.DenotTransformers.DenotTransformer import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.SymDenotations.SymDenotation diff --git a/compiler/src/dotty/tools/debug/ResolveReflectEval.scala b/compiler/src/dotty/tools/debug/ResolveReflectEval.scala index 05290de889d9..f79aa462fcb4 100644 --- a/compiler/src/dotty/tools/debug/ResolveReflectEval.scala +++ b/compiler/src/dotty/tools/debug/ResolveReflectEval.scala @@ -12,7 +12,6 @@ import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.TypeErasure.ErasedValueType import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.report import dotty.tools.dotc.transform.MegaPhase.MiniPhase import dotty.tools.dotc.transform.ValueClasses diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index ed0e39030b33..8471b06b7e97 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -4,7 +4,6 @@ package ast import core.* import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, NameOps.*, Flags.* -import TypeApplications.* import Symbols.*, StdNames.*, Trees.*, ContextOps.* import Decorators.* import Annotations.Annotation diff --git a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala index 0ffd6688647f..7268ec720ce2 100644 --- a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala +++ b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala @@ -4,7 +4,6 @@ package ast import core.* import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, Flags.* -import TypeApplications.* import Symbols.*, StdNames.*, Trees.* import Decorators.* import util.{Property, SourceFile} diff --git a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala index d5942485f0fb..8d5cd8d5d689 100644 --- a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala +++ b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala @@ -3,7 +3,6 @@ package ast import core.* import Symbols.*, Types.*, Contexts.*, Decorators.*, util.Spans.*, Flags.*, Constants.* -import TypeApplications.* import StdNames.{nme, tpnme} import ast.Trees.* import Names.Name diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index c7dcdc0e534a..8c6303d07b9a 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -4,7 +4,6 @@ package ast import core.* import Flags.*, Trees.*, Types.*, Contexts.* -import TypeApplications.* import Names.*, StdNames.*, NameOps.*, Symbols.* import Annotations.Annotation import NameKinds.ContextBoundParamName diff --git a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala index 0f6a4d091c14..dc8d9c700700 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala @@ -4,7 +4,6 @@ package ast import core.* import Types.*, Contexts.*, Flags.* -import TypeApplications.* import Symbols.*, Annotations.*, Trees.*, Symbols.*, Constants.Constant import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index 5849f9fb4d73..ef64a025805a 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -4,7 +4,6 @@ package ast import core.* import Types.*, Names.*, NameOps.*, Flags.*, util.Spans.*, Contexts.*, Constants.* -import TypeApplications.* import typer.{ ConstFold, ProtoTypes } import SymDenotations.*, Symbols.*, Denotations.*, StdNames.*, Comments.* import collection.mutable.ListBuffer diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala index cdf6faba755a..909387bbb809 100644 --- a/compiler/src/dotty/tools/dotc/ast/tpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala @@ -7,7 +7,6 @@ import typer.ProtoTypes import core.* import Scopes.newScope import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, Flags.*, NameOps.* -import TypeApplications.* import Symbols.*, StdNames.*, Annotations.*, Trees.*, Symbols.* import Decorators.*, DenotTransformers.* import collection.{immutable, mutable} diff --git a/compiler/src/dotty/tools/dotc/ast/untpd.scala b/compiler/src/dotty/tools/dotc/ast/untpd.scala index 84a9a9f22dc5..bad70cb3a01c 100644 --- a/compiler/src/dotty/tools/dotc/ast/untpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/untpd.scala @@ -4,7 +4,6 @@ package ast import core.* import Types.*, Contexts.*, Constants.*, Names.*, Flags.* -import TypeApplications.* import dotty.tools.dotc.typer.ProtoTypes import Symbols.*, StdNames.*, Trees.* import util.{Property, SourceFile, NoSource} diff --git a/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala b/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala index 49925a7d2b25..6ee57a058799 100644 --- a/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala +++ b/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala @@ -4,7 +4,6 @@ package cc import core.* import Types.*, Symbols.*, Flags.*, Contexts.*, Decorators.* -import TypeApplications.* import config.Printers.{capt, captDebug} import Annotations.Annotation import annotation.threadUnsafe diff --git a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala index ab05d71e1663..92fa632f5166 100644 --- a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala +++ b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala @@ -6,7 +6,6 @@ import core.* import Phases.*, DenotTransformers.*, SymDenotations.* import Contexts.*, Names.*, Flags.*, Symbols.*, Decorators.* import Types.*, StdNames.*, Denotations.* -import TypeApplications.* import config.Printers.{capt, recheckr, noPrinter} import config.{Config, Feature} import ast.{tpd, untpd, Trees} diff --git a/compiler/src/dotty/tools/dotc/cc/Setup.scala b/compiler/src/dotty/tools/dotc/cc/Setup.scala index 1cf4c3c8bf22..9c5ab335d99b 100644 --- a/compiler/src/dotty/tools/dotc/cc/Setup.scala +++ b/compiler/src/dotty/tools/dotc/cc/Setup.scala @@ -6,7 +6,6 @@ import core.* import Phases.*, DenotTransformers.*, SymDenotations.* import Contexts.*, Names.*, Flags.*, Symbols.*, Decorators.* import Types.*, StdNames.* -import TypeApplications.* import Annotations.Annotation import config.Feature import config.Printers.{capt, captDebug} diff --git a/compiler/src/dotty/tools/dotc/core/Annotations.scala b/compiler/src/dotty/tools/dotc/core/Annotations.scala index e6a67c1f942f..1615679a036e 100644 --- a/compiler/src/dotty/tools/dotc/core/Annotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Annotations.scala @@ -3,7 +3,6 @@ package dotc package core import Symbols.*, Types.*, Contexts.*, Constants.*, Phases.* -import TypeApplications.* import ast.tpd, tpd.* import util.Spans.Span import printing.{Showable, Printer} diff --git a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala index c08b0304c5e1..bead5ac6e74e 100644 --- a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala +++ b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala @@ -3,7 +3,6 @@ package dotc package core import Contexts.*, Types.*, Symbols.*, Names.*, Flags.* -import TypeApplications.* import Denotations.SingleDenotation import Decorators.* import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/core/Comments.scala b/compiler/src/dotty/tools/dotc/core/Comments.scala index 5eab4c119e5e..b742e3cf8f32 100644 --- a/compiler/src/dotty/tools/dotc/core/Comments.scala +++ b/compiler/src/dotty/tools/dotc/core/Comments.scala @@ -4,7 +4,6 @@ package core import ast.{ untpd, tpd } import Symbols.*, Contexts.* -import TypeApplications.* import util.{SourceFile, ReadOnlyMap} import util.Spans.* import util.CommentParsing.* diff --git a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala index 97bf2af51083..5d6169cc6990 100644 --- a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -3,7 +3,6 @@ package dotc package core import Types.* -import TypeApplications.* import Contexts.* import Symbols.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala index 0fbbb6cec6a4..c33d276cbec0 100644 --- a/compiler/src/dotty/tools/dotc/core/Contexts.scala +++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala @@ -8,7 +8,6 @@ import Periods.* import Names.* import Phases.* import Types.* -import TypeApplications.* import Symbols.* import Scopes.* import Uniques.* diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 9b3ca1f8a040..372c6994e655 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -4,7 +4,6 @@ package core import scala.annotation.{threadUnsafe => tu} import Types.*, Contexts.*, Symbols.*, SymDenotations.*, StdNames.*, Names.*, Phases.* -import TypeApplications.* import Flags.*, Scopes.*, Decorators.*, NameOps.*, Periods.*, NullOpsDecorator.* import unpickleScala2.Scala2Unpickler.ensureConstructor import scala.collection.mutable diff --git a/compiler/src/dotty/tools/dotc/core/NamerOps.scala b/compiler/src/dotty/tools/dotc/core/NamerOps.scala index 30fb3d10661d..0417ae554bef 100644 --- a/compiler/src/dotty/tools/dotc/core/NamerOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NamerOps.scala @@ -3,9 +3,9 @@ package dotc package core import Contexts.*, Symbols.*, Types.*, Flags.*, Scopes.*, Decorators.*, Names.*, NameOps.* -import TypeApplications.* import SymDenotations.{LazyType, SymDenotation}, StdNames.nme import ContextOps.enter +import TypeApplications.EtaExpansion import collection.mutable import config.Printers.typr import rewrites.Rewrites.patch diff --git a/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala b/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala index 18c46091d01c..9baf0c40a80b 100644 --- a/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala +++ b/compiler/src/dotty/tools/dotc/core/PatternTypeConstrainer.scala @@ -5,7 +5,6 @@ package core import Decorators.* import Symbols.* import Types.* -import TypeApplications.* import Flags.* import Contexts.ctx import dotty.tools.dotc.reporting.trace diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 29aa94d7c0fe..3b198ea4dbaa 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -4,10 +4,10 @@ package core import Periods.*, Contexts.*, Symbols.*, Denotations.*, Names.*, NameOps.*, Annotations.* import Types.*, Flags.*, Decorators.*, DenotTransformers.*, StdNames.*, Scopes.* -import TypeApplications.* import NameOps.*, NameKinds.* import Phases.{Phase, typerPhase, unfusedPhases} import Constants.Constant +import TypeApplications.TypeParamInfo import Scopes.Scope import dotty.tools.io.AbstractFile import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index 5651d0f617db..f3496a8636dd 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -14,7 +14,6 @@ import Denotations.* import printing.Texts.* import printing.Printer import Types.* -import TypeApplications.* import util.Spans.* import DenotTransformers.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 7f24a54ea7ad..e1d4633e3ca4 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -3,7 +3,6 @@ package dotc package core import Types.* -import TypeApplications.* import Contexts.* import Symbols.* import SymDenotations.LazyType @@ -27,7 +26,7 @@ object TypeApplications: * * @param tycon C */ - object EtaExpansion: // note typer.EtaExpansion + object EtaExpansion: /** Test that the parameter bounds in a hk type lambda `[X1,...,Xn] => C[X1, ..., Xn]` * contain the bounds of the type parameters of `C`. This is necessary to be able to @@ -150,7 +149,11 @@ object TypeApplications: } } - // Extensions that model type application. +/** Extensions that model type application. + */ +trait TypeApplications: + import TypeApplications.* + extension (self: Type) { // braces to avoid indent /** The type parameters of this type are: * For a ClassInfo type, the type parameters of its class. @@ -307,7 +310,7 @@ object TypeApplications: /** Convert a type constructor `TC` which has type parameters `X1, ..., Xn` * to `[X1, ..., Xn] -> TC[X1, ..., Xn]`. */ - def etaExpand(using Context): Type = // note typer.EtaExpansion.etaExpand + def etaExpand(using Context): Type = val tparams = self.typeParams val resType = self.appliedTo(tparams.map(_.paramRef)) self.dealias match diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 994747fab894..77fdc24a01cc 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -3,7 +3,6 @@ package dotc package core import Types.*, Contexts.*, Symbols.*, Flags.*, Names.*, NameOps.*, Denotations.* -import TypeApplications.* import Decorators.* import Phases.{gettersPhase, elimByNamePhase} import StdNames.nme diff --git a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala index 89aea795115b..c29b971f1a5a 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala @@ -3,7 +3,6 @@ package dotc package core import Symbols.*, Types.*, Contexts.*, Flags.*, Names.*, StdNames.*, Phases.* -import TypeApplications.* import Flags.JavaDefined import Uniques.unique import backend.sjs.JSDefinitions diff --git a/compiler/src/dotty/tools/dotc/core/TypeEval.scala b/compiler/src/dotty/tools/dotc/core/TypeEval.scala index 1ace92e7ff04..98578f353b96 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeEval.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeEval.scala @@ -3,7 +3,6 @@ package dotc package core import Types.*, Contexts.*, Symbols.*, Constants.*, Decorators.* -import TypeApplications.* import config.Printers.typr import reporting.trace import StdNames.tpnme diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index af97d3291ebb..af449f323558 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -3,7 +3,6 @@ package dotc package core import Contexts.*, Types.*, Symbols.*, Names.*, NameKinds.*, Flags.* -import TypeApplications.* import SymDenotations.* import util.Spans.* import util.Stats diff --git a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala index 6fa139e7fc80..594249065d98 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala @@ -4,7 +4,6 @@ package core import TypeErasure.ErasedValueType import Types.*, Contexts.*, Symbols.*, Flags.*, Decorators.*, SymDenotations.* -import TypeApplications.* import Names.{Name, TermName} import Constants.Constant diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 7e505d455f7b..63f86565a180 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -19,7 +19,6 @@ import Denotations.* import Periods.* import CheckRealizable.* import Variances.{Variance, setStructuralVariances, Invariant} -import TypeApplications.* import typer.Nullables import util.Stats.* import util.{SimpleIdentityMap, SimpleIdentitySet} @@ -2170,7 +2169,11 @@ object Types extends TypeUtils { /** Is the `hash` of this type the same for all possible sequences of enclosing binders? */ def hashIsStable: Boolean = true } - end Type + object Type: + // Extensions that model type application. + given TypeApplications() + + // end Type // ----- Type categories ---------------------------------------------- diff --git a/compiler/src/dotty/tools/dotc/core/Variances.scala b/compiler/src/dotty/tools/dotc/core/Variances.scala index 392f3de4dbfe..e18a31e46769 100644 --- a/compiler/src/dotty/tools/dotc/core/Variances.scala +++ b/compiler/src/dotty/tools/dotc/core/Variances.scala @@ -2,7 +2,7 @@ package dotty.tools.dotc package core import Types.*, Contexts.*, Flags.*, Symbols.*, Annotations.* -import TypeApplications.* +import TypeApplications.TypeParamInfo import Decorators.* object Variances { diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 7d4a61d39503..ea8a74d18192 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -8,7 +8,6 @@ import scala.language.unsafeNulls import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler } import Contexts.*, Symbols.*, Types.*, Names.*, StdNames.*, NameOps.*, Scopes.*, Decorators.* -import TypeApplications.* import SymDenotations.*, unpickleScala2.Scala2Unpickler.*, Constants.*, Annotations.*, util.Spans.* import Phases.* import ast.{ tpd, untpd } diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 9e13f8ceea49..aa1fbf371fec 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -9,7 +9,6 @@ import Comments.docCtx import Contexts.* import Symbols.* import Types.* -import TypeApplications.* import Scopes.* import SymDenotations.* import Denotations.* diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index d457dc7a551a..5087044f73e8 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -10,7 +10,6 @@ import java.lang.Float.intBitsToFloat import java.lang.Double.longBitsToDouble import Contexts.*, Symbols.*, Types.*, Scopes.*, SymDenotations.*, Names.*, NameOps.* -import TypeApplications.* import StdNames.*, Denotations.*, NameOps.*, Flags.*, Constants.*, Annotations.*, Phases.* import NameKinds.{Scala2MethodNameKinds, SuperAccessorName, ExpandedName} import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala index dd11f546aac6..356e5ad40fdd 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala @@ -4,7 +4,6 @@ package inlines import ast.*, core.* import Flags.*, Symbols.*, Types.*, Decorators.*, Constants.*, Contexts.* -import TypeApplications.* import StdNames.nme import typer.* import Names.Name diff --git a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala index c03a95f3d6d0..2dd86132fb97 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala @@ -4,7 +4,6 @@ package inlines import ast.*, core.* import Flags.*, Symbols.*, Types.*, Decorators.*, Constants.*, Contexts.* -import TypeApplications.* import StdNames.{tpnme, nme} import NameOps.* import typer.* diff --git a/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala b/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala index a7dc144e335a..47a47f10f905 100644 --- a/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala +++ b/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala @@ -9,7 +9,6 @@ import Flags.* import Symbols.* import Flags.* import Types.* -import TypeApplications.* import Decorators.* import StdNames.nme import Contexts.* diff --git a/compiler/src/dotty/tools/dotc/interactive/Completion.scala b/compiler/src/dotty/tools/dotc/interactive/Completion.scala index 2b399f7dc7c9..7b2c5977fdbd 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Completion.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Completion.scala @@ -19,7 +19,6 @@ import dotty.tools.dotc.core.SymDenotations.SymDenotation import dotty.tools.dotc.core.TypeError import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Types.{AppliedType, ExprType, MethodOrPoly, NameFilter, NoType, RefinedType, TermRef, Type, TypeProxy} -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.parsing.Tokens import dotty.tools.dotc.typer.Implicits.SearchSuccess import dotty.tools.dotc.typer.Inferencing diff --git a/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala b/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala index 67dd76d85257..c15e6c93bf90 100644 --- a/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala @@ -15,7 +15,6 @@ import Contexts.* import Symbols.defn import Names.* import Types.* -import TypeApplications.* import ast.Trees.* import Decorators.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala index ece5b797f3c2..90dfb72ef010 100644 --- a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -3,7 +3,6 @@ package printing import core.* import Texts.*, Types.*, Flags.*, Names.*, Symbols.*, NameOps.*, Constants.*, Denotations.* -import TypeApplications.* import StdNames.* import Contexts.* import Scopes.Scope, Denotations.Denotation, Annotations.Annotation diff --git a/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala b/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala index 213d09c41b92..1ec54577da23 100644 --- a/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala +++ b/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala @@ -17,7 +17,6 @@ import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.TypeOps.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.reporting.IllegalVariableInPatternAlternative diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala index bbe0cfc12cc4..c281cbab544e 100644 --- a/compiler/src/dotty/tools/dotc/reporting/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala @@ -5,7 +5,6 @@ package reporting import core.* import Contexts.* import Decorators.*, Symbols.*, Names.*, NameOps.*, Types.*, Flags.*, Phases.* -import TypeApplications.* import Denotations.SingleDenotation import SymDenotations.SymDenotation import NameKinds.{WildcardParamName, ContextFunctionParamName} diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index f2237a65266e..41a586b46b43 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -13,7 +13,6 @@ import Flags.* import Phases.* import Trees.* import Types.* -import TypeApplications.* import Symbols.* import Names.* import StdNames.str diff --git a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala index eeca23adc591..3f156e5a7b40 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala @@ -5,7 +5,6 @@ package semanticdb import core.Symbols.* import core.Contexts.Context import core.Types.* -import core.TypeApplications.* import core.Annotations.Annotation import core.Flags import core.Names.Name diff --git a/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala b/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala index cf9eee846d56..b958b64f7c54 100644 --- a/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala +++ b/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala @@ -10,7 +10,6 @@ import dotty.tools.dotc.core.NameKinds.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.quoted.QuotePatterns import dotty.tools.dotc.staging.QuoteTypeTags.* import dotty.tools.dotc.staging.StagingLevel.* diff --git a/compiler/src/dotty/tools/dotc/staging/HealType.scala b/compiler/src/dotty/tools/dotc/staging/HealType.scala index cc7d4c3d86c2..509049e131c8 100644 --- a/compiler/src/dotty/tools/dotc/staging/HealType.scala +++ b/compiler/src/dotty/tools/dotc/staging/HealType.scala @@ -9,7 +9,6 @@ import core.Flags.* import core.StdNames.* import core.Symbols.* import core.Types.* -import core.TypeApplications.* import StagingLevel.* import QuoteTypeTags.* diff --git a/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala b/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala index d1c9077bf182..cbf3437cdaad 100644 --- a/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala +++ b/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala @@ -10,7 +10,6 @@ import Names.* import NameOps.* import Decorators.* import Types.* -import TypeApplications.* import util.Spans.Span import config.Printers.transforms import Annotations.ExperimentalAnnotation diff --git a/compiler/src/dotty/tools/dotc/transform/Bridges.scala b/compiler/src/dotty/tools/dotc/transform/Bridges.scala index 68266e6b960c..482e5056fad0 100644 --- a/compiler/src/dotty/tools/dotc/transform/Bridges.scala +++ b/compiler/src/dotty/tools/dotc/transform/Bridges.scala @@ -4,7 +4,6 @@ package transform import core.* import Symbols.*, Types.*, Contexts.*, Decorators.*, Flags.*, Scopes.*, Phases.* -import TypeApplications.* import DenotTransformers.* import ast.untpd import collection.{mutable, immutable} diff --git a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala index 931cbad100be..2bf164f4b2a3 100644 --- a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala +++ b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala @@ -11,7 +11,6 @@ import core.StdNames.nme import core.Names.* import core.NameKinds.TempResultName import core.Constants.* -import core.TypeApplications.* import util.Store import dotty.tools.uncheckedNN import ast.tpd.* diff --git a/compiler/src/dotty/tools/dotc/transform/Constructors.scala b/compiler/src/dotty/tools/dotc/transform/Constructors.scala index d872c44d83cb..b373565489f0 100644 --- a/compiler/src/dotty/tools/dotc/transform/Constructors.scala +++ b/compiler/src/dotty/tools/dotc/transform/Constructors.scala @@ -16,7 +16,6 @@ import Decorators.* import DenotTransformers.* import collection.mutable import Types.* -import TypeApplications.* object Constructors { val name: String = "constructors" diff --git a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala index 63e91175ee93..0bf2dc107ce9 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimByName.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimByName.scala @@ -6,7 +6,6 @@ import core.* import Contexts.* import Symbols.* import Types.* -import TypeApplications.* import Flags.* import SymDenotations.* import DenotTransformers.InfoTransformer diff --git a/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala b/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala index 084dec866add..ae2fc578728f 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimRepeated.scala @@ -5,7 +5,6 @@ package transform import core.* import StdNames.nme import Types.* -import TypeApplications.* import transform.MegaPhase.* import Flags.* import Contexts.* diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala index 5c7b77c71117..9a8f5596471f 100644 --- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala +++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala @@ -10,7 +10,6 @@ import core.SymDenotations.* import core.Symbols.* import core.Contexts.* import core.Types.* -import core.TypeApplications.* import core.Names.* import core.StdNames.* import core.NameOps.* diff --git a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala index 4dcf417041d3..f76419f5198e 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala @@ -5,7 +5,6 @@ package transform import core.* import Scopes.newScope import Contexts.*, Symbols.*, Types.*, Flags.*, Decorators.*, StdNames.*, Constants.* -import TypeApplications.* import MegaPhase.* import Names.TypeName diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala index 22da139425dd..c1b3c5a6493d 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -8,7 +8,6 @@ import core.Symbols.* import core.Contexts.* import core.Phases.* import core.Types.* -import core.TypeApplications.* import core.Flags.* import core.Decorators.* import core.StdNames.nme diff --git a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala index b30b66224595..81cc73c26ed6 100644 --- a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala +++ b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala @@ -7,7 +7,6 @@ import dotty.tools.dotc.transform.MegaPhase.* import ast.untpd import Flags.* import Types.* -import TypeApplications.* import Constants.Constant import Contexts.* import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala index 6f68182a679f..35797922482d 100644 --- a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala +++ b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala @@ -3,7 +3,6 @@ package transform import core.* import Types.* -import TypeApplications.* import Contexts.* import Symbols.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala b/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala index 97aefba57b7b..4cf176cfda3a 100644 --- a/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala +++ b/compiler/src/dotty/tools/dotc/transform/FunctionXXLForwarders.scala @@ -11,7 +11,6 @@ import StdNames.* import Symbols.* import MegaPhase.* import Types.* -import TypeApplications.* /** This phase adds forwarder for XXL functions `apply` methods that are implemented with a method diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index b6625a6527c8..a882ed8f41c2 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -13,7 +13,6 @@ import core.Symbols.* import core.TypeApplications.{EtaExpansion, TypeParamInfo} import core.TypeErasure.{erasedGlb, erasure, fullErasure, isGenericArrayElement, tupleArity} import core.Types.* -import core.TypeApplications.* import core.classfile.ClassfileConstants import config.Printers.transforms diff --git a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala index ca7358b46e0c..96cffeb1097d 100644 --- a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala +++ b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala @@ -7,7 +7,6 @@ import core.Symbols.* import core.Contexts.* import ast.TreeTypeMap import core.Types.* -import core.TypeApplications.* import core.Flags.* import core.Decorators.* import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala b/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala index 5685298da17a..449402f17fce 100644 --- a/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala +++ b/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala @@ -13,7 +13,6 @@ import core.Constants.Constant import core.NameOps.isContextFunction import core.StdNames.nme import core.Types.* -import core.TypeApplications.* import core.Decorators.* import coverage.* import typer.LiftCoverage diff --git a/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala b/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala index 2654a17f7772..9f99e7a6fbd3 100644 --- a/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala +++ b/compiler/src/dotty/tools/dotc/transform/Instrumentation.scala @@ -6,7 +6,6 @@ import core.* import Contexts.* import Symbols.* import Flags.* -import TypeApplications.* import Decorators.* import MegaPhase.* diff --git a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala index f7a9417b5b20..c2fdccc2861e 100644 --- a/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/InterceptedMethods.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.core.Names.TermName import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.transform.MegaPhase.MiniPhase object InterceptedMethods { diff --git a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala index 8283b1759f45..db3157f6130d 100644 --- a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala +++ b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala @@ -13,7 +13,6 @@ import core.NameKinds.{ExpandedName, LazyBitMapName, LazyLocalInitName, LazyLoca import core.StdNames.nme import core.Symbols.* import core.Types.* -import core.TypeApplications.* import core.{Names, StdNames} import dotty.tools.dotc.config.Feature import transform.MegaPhase.MiniPhase diff --git a/compiler/src/dotty/tools/dotc/transform/Memoize.scala b/compiler/src/dotty/tools/dotc/transform/Memoize.scala index 5b078066dfac..0b4d4c7dbf59 100644 --- a/compiler/src/dotty/tools/dotc/transform/Memoize.scala +++ b/compiler/src/dotty/tools/dotc/transform/Memoize.scala @@ -8,7 +8,6 @@ import Phases.* import SymDenotations.SymDenotation import Denotations.* import Symbols.* -import TypeApplications.* import Constants.* import MegaPhase.* diff --git a/compiler/src/dotty/tools/dotc/transform/Mixin.scala b/compiler/src/dotty/tools/dotc/transform/Mixin.scala index cdeb027eabfb..a9813ec90b1a 100644 --- a/compiler/src/dotty/tools/dotc/transform/Mixin.scala +++ b/compiler/src/dotty/tools/dotc/transform/Mixin.scala @@ -10,7 +10,6 @@ import Flags.* import Symbols.* import SymDenotations.* import Types.* -import TypeApplications.* import Decorators.* import DenotTransformers.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala index b2f668b2d490..6ff81ab13cf1 100644 --- a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala +++ b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala @@ -3,7 +3,6 @@ package transform import core.* import Contexts.*, Symbols.*, Types.*, Flags.*, StdNames.* -import TypeApplications.* import MegaPhase.* import NameKinds.NonLocalReturnKeyName import config.SourceVersion.* diff --git a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala index 75b7fb0d9297..16c50b9cd474 100644 --- a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala +++ b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala @@ -4,7 +4,6 @@ package transform import core.* import Flags.*, Symbols.*, Contexts.*, Scopes.*, Decorators.*, Types.Type -import TypeApplications.* import NameKinds.DefaultGetterName import NullOpsDecorator.* import collection.immutable.BitSet diff --git a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala index 5c9b52cad862..273879f3c3cb 100644 --- a/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -5,7 +5,6 @@ package transform import core.* import MegaPhase.* import Symbols.*, Contexts.*, Types.*, StdNames.*, NameOps.* -import TypeApplications.* import patmat.SpaceEngine import util.Spans.* import typer.Applications.* diff --git a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala index ff60467e2975..d9a1ea9ad9af 100644 --- a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala +++ b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala @@ -5,7 +5,6 @@ import core.* import Decorators.* import Flags.* import Types.* -import TypeApplications.* import Contexts.* import Symbols.* import Constants.* diff --git a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala index 2c443e6faae7..29baf816da5e 100644 --- a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala +++ b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala @@ -10,7 +10,6 @@ import dotty.tools.dotc.inlines.Inlines import dotty.tools.dotc.typer.VarianceChecker import typer.ErrorReporting.errorTree import Types.*, Contexts.*, Names.*, Flags.*, DenotTransformers.*, Phases.* -import TypeApplications.* import SymDenotations.*, StdNames.*, Annotations.*, Trees.*, Scopes.* import Decorators.* import Symbols.*, NameOps.* diff --git a/compiler/src/dotty/tools/dotc/transform/Recheck.scala b/compiler/src/dotty/tools/dotc/transform/Recheck.scala index e5d4925bb803..6a12e3ccf3b6 100644 --- a/compiler/src/dotty/tools/dotc/transform/Recheck.scala +++ b/compiler/src/dotty/tools/dotc/transform/Recheck.scala @@ -4,7 +4,6 @@ package transform import core.* import Symbols.*, Contexts.*, Types.*, ContextOps.*, Decorators.*, SymDenotations.* -import TypeApplications.* import Flags.*, NameKinds.*, Denotations.{Denotation, SingleDenotation} import ast.* import Names.Name diff --git a/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala b/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala index fa6913c3dc0e..f1603db0e5a0 100644 --- a/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala +++ b/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala @@ -5,7 +5,6 @@ import core.* import Decorators.* import Flags.* import Types.* -import TypeApplications.* import Contexts.* import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala index 3015c4922aa2..a7c9b679d65e 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala @@ -3,7 +3,6 @@ package transform import ast.Trees.*, ast.tpd, core.* import Contexts.*, Types.*, Decorators.*, Symbols.*, DenotTransformers.* -import TypeApplications.* import SymDenotations.*, Scopes.*, StdNames.*, NameOps.*, Names.* import MegaPhase.MiniPhase import config.Feature diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala index 2c35e8bfe6ce..007ea3112c09 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala @@ -3,7 +3,6 @@ package transform import ast.Trees.*, ast.tpd, core.* import Contexts.*, Types.*, Decorators.*, Symbols.*, DenotTransformers.* -import TypeApplications.* import SymDenotations.*, Scopes.*, StdNames.*, NameOps.*, Names.*, NameKinds.* import MegaPhase.MiniPhase diff --git a/compiler/src/dotty/tools/dotc/transform/Splicing.scala b/compiler/src/dotty/tools/dotc/transform/Splicing.scala index 7dc2bc38fa8e..967c1cb6d19b 100644 --- a/compiler/src/dotty/tools/dotc/transform/Splicing.scala +++ b/compiler/src/dotty/tools/dotc/transform/Splicing.scala @@ -5,7 +5,6 @@ import core.* import Decorators.* import Flags.* import Types.* -import TypeApplications.* import Contexts.* import Symbols.* import Constants.* diff --git a/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala b/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala index 68f79bc8f27b..f54e69d971f8 100644 --- a/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala +++ b/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala @@ -3,7 +3,6 @@ package transform import core.* import Symbols.*, Types.*, Contexts.*, Names.*, StdNames.*, Constants.* -import TypeApplications.* import Flags.* import DenotTransformers.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index 266d95d3130d..d9c6da8d97eb 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -9,7 +9,6 @@ import core.SymDenotations.* import core.Contexts.* import core.Symbols.* import core.Types.* -import core.TypeApplications.* import core.Flags.* import core.StdNames.* import core.NameKinds.{DocArtifactName, OuterSelectName} @@ -895,4 +894,4 @@ object TreeChecker { case _ => Nil } -} +} \ No newline at end of file diff --git a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala index c96988e21403..bdb7072a6530 100644 --- a/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala +++ b/compiler/src/dotty/tools/dotc/transform/TupleOptimizations.scala @@ -10,7 +10,6 @@ import StdNames.* import Symbols.* import MegaPhase.* import Types.* -import TypeApplications.* import dotty.tools.dotc.ast.tpd /** Optimize generic operations on tuples */ diff --git a/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index fb0eaaf9da00..a8c8ec8ce1d8 100644 --- a/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala +++ b/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala @@ -6,7 +6,6 @@ import scala.language.unsafeNulls as _ import core.* import Contexts.*, Symbols.*, Types.*, Constants.*, StdNames.*, Decorators.* -import TypeApplications.* import ast.untpd import Erasure.Boxing.* import TypeErasure.* diff --git a/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala b/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala index d08eb73f20eb..bf9e20e68930 100644 --- a/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala +++ b/compiler/src/dotty/tools/dotc/transform/UnrollDefinitions.scala @@ -15,7 +15,6 @@ import Names.* import dotty.tools.dotc.core.NameKinds.DefaultGetterName import dotty.tools.dotc.core.Types.{MethodType, NamedType, PolyType, Type, NoPrefix, NoType} -import TypeApplications.* import dotty.tools.dotc.printing.Formatting.hl diff --git a/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala b/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala index 0b789330332c..55b26d89b5a0 100644 --- a/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/VCInlineMethods.scala @@ -5,7 +5,6 @@ package transform import ast.{Trees, tpd} import core.* import Contexts.*, Trees.*, Types.* -import TypeApplications.* import DenotTransformers.*, MegaPhase.* import ExtensionMethods.*, ValueClasses.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala index a720f349e0a3..474ec4de7962 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala @@ -6,7 +6,6 @@ import core.* import Contexts.* import Symbols.* import Types.* -import TypeApplications.* import Denotations.Denotation import StdNames.* import Names.TermName diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index fbc75efa300c..8ede7ba831f5 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -5,7 +5,6 @@ package patmat import core.* import Constants.*, Contexts.*, Decorators.*, Flags.*, NullOpsDecorator.*, Symbols.*, Types.* -import TypeApplications.* import Names.*, NameOps.*, StdNames.* import ast.*, tpd.* import config.Printers.exhaustivity diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala b/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala index aa5590a760bf..951024f3d4db 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/AddLocalJSFakeNews.scala @@ -9,7 +9,6 @@ import core.Contexts.* import core.Decorators.* import core.StdNames.nme import core.Symbols.* -import core.TypeApplications.* import dotty.tools.backend.sjs.JSDefinitions.jsdefn diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala b/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala index 27bfcd5c867f..5c7119860ae4 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/ExplicitJSClasses.scala @@ -13,7 +13,6 @@ import core.DenotTransformers.* import core.Symbols.* import core.Contexts.* import core.Types.* -import core.TypeApplications.* import core.Flags.* import core.Decorators.* import core.StdNames.nme diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala b/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala index 028964104977..b7a179ac7562 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/JUnitBootstrappers.scala @@ -13,7 +13,6 @@ import Scopes.* import Symbols.* import StdNames.* import Types.* -import TypeApplications.* import Decorators.em import dotty.tools.dotc.transform.MegaPhase.* diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala index a32d7b9e67a5..43b29a224564 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSExports.scala @@ -13,7 +13,6 @@ import StdNames.* import Symbols.* import Types.* -import TypeApplications.* import util.Spans.Span import util.SrcPos diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala index de49ec4f5481..77950d21ab58 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala @@ -20,7 +20,6 @@ import StdNames.* import Symbols.* import Types.* -import TypeApplications.* import JSSymUtils.* diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 299a4ea7d3cd..5944a586d1cf 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -11,7 +11,6 @@ import Flags.* import Symbols.* import Denotations.Denotation import Types.* -import TypeApplications.* import Decorators.* import ErrorReporting.* import Trees.* @@ -30,6 +29,7 @@ import util.chaining.tap import collection.mutable import config.Printers.{overload, typr, unapp} +import TypeApplications.* import Annotations.Annotation import Constants.{Constant, IntTag} diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index a71189f62eac..7f52c871f9de 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -6,7 +6,6 @@ import core.* import ast.* import Contexts.* import Types.* -import TypeApplications.* import Flags.* import Names.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/typer/Deriving.scala b/compiler/src/dotty/tools/dotc/typer/Deriving.scala index 180202a0f818..ef77adf18626 100644 --- a/compiler/src/dotty/tools/dotc/typer/Deriving.scala +++ b/compiler/src/dotty/tools/dotc/typer/Deriving.scala @@ -7,7 +7,6 @@ import ast.* import ast.Trees.* import StdNames.* import Contexts.*, Symbols.*, Types.*, SymDenotations.*, Names.*, NameOps.*, Flags.*, Decorators.* -import TypeApplications.* import ProtoTypes.*, ContextOps.* import util.Spans.* import util.SrcPos diff --git a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala index da27a24d4d27..683244cc8795 100644 --- a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala +++ b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala @@ -12,7 +12,6 @@ import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.Names.{Name, TermName} import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.TypeErasure import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala index 3ba61aa671cf..3fb02026f7aa 100644 --- a/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala +++ b/compiler/src/dotty/tools/dotc/typer/EtaExpansion.scala @@ -6,7 +6,6 @@ import core.* import ast.{Trees, untpd, tpd} import Contexts.* import Types.* -import TypeApplications.* import Flags.* import Symbols.* import Names.* diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index b8bcc52b58d5..d3e3a0d06bd8 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -11,7 +11,6 @@ import printing.{Showable, Printer} import printing.Texts.* import Contexts.* import Types.* -import TypeApplications.* import Flags.* import Mode.ImplicitsEnabled import NameKinds.{LazyImplicitName, ContextBoundParamName} diff --git a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala index 9cb3bdde44b7..b7861c236b73 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala @@ -5,7 +5,6 @@ package typer import core.* import ast.* import Contexts.*, Types.*, Flags.*, Symbols.* -import TypeApplications.* import ProtoTypes.* import NameKinds.UniqueName import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 7938308142d5..02a55be9ea5a 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -6,7 +6,6 @@ import core.* import ast.* import Trees.*, StdNames.*, Scopes.*, Denotations.*, NamerOps.*, ContextOps.* import Contexts.*, Symbols.*, Types.*, SymDenotations.*, Names.*, NameOps.*, Flags.* -import TypeApplications.* import Decorators.*, Comments.{_, given} import NameKinds.DefaultGetterName import ast.desugar, ast.desugar.* diff --git a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala index 4b1f4a7291cb..4fc092d16007 100644 --- a/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -5,7 +5,6 @@ package typer import core.* import ast.* import Contexts.*, Types.*, Denotations.*, Names.*, StdNames.*, NameOps.*, Symbols.* -import TypeApplications.* import NameKinds.DepParamName import Trees.* import Constants.* diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index fe7bb247e4f3..f979654e9811 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -14,7 +14,6 @@ import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.inlines.PrepareInlineable import dotty.tools.dotc.quoted.QuotePatterns import dotty.tools.dotc.staging.StagingLevel.* diff --git a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala index bd90cf5361d2..8400639706d6 100644 --- a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala +++ b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala @@ -4,7 +4,6 @@ package typer import core.* import Contexts.* import Types.* -import TypeApplications.* import Symbols.* import StdNames.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 26aad6bebb93..1006044e851d 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -5,7 +5,6 @@ package typer import transform.* import core.* import Symbols.*, Types.*, Contexts.*, Flags.*, Names.*, NameOps.*, NameKinds.* -import TypeApplications.* import StdNames.*, Denotations.*, Phases.*, SymDenotations.* import NameKinds.DefaultGetterName import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala index a08dd1fca7c8..3b114de6a05c 100644 --- a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala @@ -6,7 +6,6 @@ import core.* import util.Spans.Span import Contexts.* import Types.*, Flags.*, Symbols.*, Names.*, StdNames.*, Constants.* -import TypeApplications.* import TypeErasure.{erasure, hasStableErasure} import Decorators.* import ProtoTypes.* diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala index a06729066a91..55b6384c9e89 100644 --- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -6,7 +6,6 @@ import core.* import ast.* import Contexts.*, ContextOps.*, Constants.*, Types.*, Symbols.*, Names.*, Flags.*, Decorators.* import ErrorReporting.*, Annotations.*, Denotations.*, SymDenotations.*, StdNames.* -import TypeApplications.* import util.SrcPos import NameOps.* import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 97e35924db18..7432a0900ac5 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -14,7 +14,6 @@ import ProtoTypes.* import Contexts.* import Symbols.* import Types.* -import TypeApplications.* import SymDenotations.* import Annotations.* import Names.* @@ -28,7 +27,7 @@ import ErrorReporting.* import Checking.* import Inferencing.* import Dynamic.isDynamicExpansion -import typer.EtaExpansion.etaExpand +import EtaExpansion.etaExpand import TypeComparer.CompareResult import inlines.{Inlines, PrepareInlineable} import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala b/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala index 140d4fd0973d..354f09382d82 100644 --- a/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala +++ b/compiler/src/dotty/tools/dotc/typer/VarianceChecker.scala @@ -4,7 +4,6 @@ package typer import dotty.tools.dotc.ast.{ Trees, tpd } import core.* import Types.*, Contexts.*, Flags.*, Symbols.*, Trees.* -import TypeApplications.* import Decorators.* import Variances.* import NameKinds.* diff --git a/compiler/src/dotty/tools/dotc/util/Signatures.scala b/compiler/src/dotty/tools/dotc/util/Signatures.scala index 0d4405a8191f..3b45d8f2fa51 100644 --- a/compiler/src/dotty/tools/dotc/util/Signatures.scala +++ b/compiler/src/dotty/tools/dotc/util/Signatures.scala @@ -16,7 +16,6 @@ import core.Flags import core.Names.* import core.NameKinds import core.Types.* -import core.TypeApplications.* import core.Symbols.{NoSymbol, isLocalToBlock} import interactive.Interactive import util.Spans.Span diff --git a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala index 29453335e20e..e4a17e04a7d1 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.Mode.GadtConstraintInference import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.util.optional diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 5bd32b3cd981..4cc4d4e99e3f 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -14,7 +14,6 @@ import dotty.tools.dotc.core.NameOps.* import dotty.tools.dotc.core.Scopes.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types -import dotty.tools.dotc.core.TypeApplications, TypeApplications.* import dotty.tools.dotc.NoCompilationUnit import dotty.tools.dotc.quoted.MacroExpansion import dotty.tools.dotc.quoted.PickledQuotes @@ -1912,9 +1911,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler dotc.core.Symbols.defn.isTupleNType(self) def select(sym: Symbol): TypeRepr = self.select(sym) def appliedTo(targ: TypeRepr): TypeRepr = - TypeApplications.appliedTo(self)(targ) + Types.Type.given_TypeApplications.appliedTo(self)(targ) def appliedTo(targs: List[TypeRepr]): TypeRepr = - TypeApplications.appliedTo(self)(targs) + Types.Type.given_TypeApplications.appliedTo(self)(targs) def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr = self.subst(from, to) diff --git a/compiler/test/dotty/tools/AnnotationsTests.scala b/compiler/test/dotty/tools/AnnotationsTests.scala index aa5f9a94373b..3998bf7c93c0 100644 --- a/compiler/test/dotty/tools/AnnotationsTests.scala +++ b/compiler/test/dotty/tools/AnnotationsTests.scala @@ -10,7 +10,6 @@ import dotc.core.Contexts._ import dotc.core.Phases._ import dotc.core.Types._ import dotc.core.Symbols._ -import dotc.core.TypeApplications.* import java.io.File import java.nio.file._ diff --git a/compiler/test/dotty/tools/SignatureTest.scala b/compiler/test/dotty/tools/SignatureTest.scala index d67a53657423..587d7098a0a7 100644 --- a/compiler/test/dotty/tools/SignatureTest.scala +++ b/compiler/test/dotty/tools/SignatureTest.scala @@ -12,7 +12,6 @@ import dotc.core.Flags._ import dotc.core.Phases._ import dotc.core.Names._ import dotc.core.Types._ -import dotc.core.TypeApplications.* import dotc.core.Symbols._ import dotc.core.StdNames._ import dotc.core.Signature diff --git a/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala b/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala index 4843d5b87a10..d7b2fd6a5173 100644 --- a/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala +++ b/compiler/test/dotty/tools/dotc/transform/patmat/SpaceEngineTest.scala @@ -4,7 +4,6 @@ package transform package patmat import core.*, Annotations.*, Contexts.*, Decorators.*, Flags.*, Names.*, StdNames.*, Symbols.*, Types.* -import TypeApplications.* import ast.*, tpd.* import vulpix.TestConfiguration, TestConfiguration.basicClasspath diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala index 3ba9333048e1..05d97972d76e 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/CompletionValue.scala @@ -9,7 +9,6 @@ import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.core.Symbols.Symbol import dotty.tools.dotc.core.Types.Type -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.pc.printer.ShortenedTypePrinter import dotty.tools.pc.utils.InteractiveEnrichments.decoded diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala index 9604bbac2082..72b65b3cadb9 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala @@ -25,7 +25,6 @@ import dotty.tools.dotc.core.StdNames import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.interactive.Completion import dotty.tools.dotc.interactive.Completion.Mode import dotty.tools.dotc.util.SourcePosition diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala index 76cfaf76dc3e..2e89b4e5bb99 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/MatchCaseCompletions.scala @@ -28,7 +28,6 @@ import dotty.tools.dotc.core.Types.OrType import dotty.tools.dotc.core.Types.Type import dotty.tools.dotc.core.Types.TypeRef import dotty.tools.dotc.core.Types.AppliedType -import dotty.tools.dotc.core.TypeApplications.* import dotty.tools.dotc.typer.Applications.UnapplyArgs import dotty.tools.dotc.util.SourcePosition import dotty.tools.pc.AutoImports.AutoImportsGenerator From ad531d91782e919d164cf7460040cd63cfdc0b25 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Wed, 23 Jul 2025 11:13:38 -0700 Subject: [PATCH 5/5] Switch TypeApplications to inherited extensions --- compiler/src/dotty/tools/dotc/core/TypeApplications.scala | 4 ++-- compiler/src/dotty/tools/dotc/core/TypeUtils.scala | 2 +- compiler/src/dotty/tools/dotc/core/Types.scala | 6 +----- compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index e1d4633e3ca4..fdc37000735f 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -151,10 +151,10 @@ object TypeApplications: /** Extensions that model type application. */ -trait TypeApplications: +class TypeApplications: import TypeApplications.* - extension (self: Type) { // braces to avoid indent + extension (self: Type) { // braces to avoid indenting existing code /** The type parameters of this type are: * For a ClassInfo type, the type parameters of its class. * For a typeref referring to a class, the type parameters of the class. diff --git a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala index 594249065d98..cb4beee434c5 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala @@ -11,7 +11,7 @@ import Names.Name import StdNames.nme import config.Feature -class TypeUtils: +class TypeUtils extends TypeApplications: /** A decorator that provides methods on types * that are needed in the transformer pipeline. */ diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 63f86565a180..ad3c0b7fbf3c 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2169,11 +2169,7 @@ object Types extends TypeUtils { /** Is the `hash` of this type the same for all possible sequences of enclosing binders? */ def hashIsStable: Boolean = true } - object Type: - // Extensions that model type application. - given TypeApplications() - - // end Type + end Type // ----- Type categories ---------------------------------------------- diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 4cc4d4e99e3f..f8dc48f28c3a 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -1911,9 +1911,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler dotc.core.Symbols.defn.isTupleNType(self) def select(sym: Symbol): TypeRepr = self.select(sym) def appliedTo(targ: TypeRepr): TypeRepr = - Types.Type.given_TypeApplications.appliedTo(self)(targ) + Types.appliedTo(self)(targ) def appliedTo(targs: List[TypeRepr]): TypeRepr = - Types.Type.given_TypeApplications.appliedTo(self)(targs) + Types.appliedTo(self)(targs) def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr = self.subst(from, to)