From 04fca6b5cdf18df4f8c60805b90cc2e9521867ab 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 136384413810..da869c7203b4 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -17,12 +17,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] @@ -153,13 +147,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. @@ -554,7 +544,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) @@ -588,4 +578,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 95e8ae9ba81c..d914fb8a3519 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -4374,10 +4374,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 = @@ -4390,7 +4390,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) @@ -7183,7 +7183,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 fdd16963d33b..5af334d45c34 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -1897,9 +1897,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 8fa281e29aeae3b3565071fd5df2db51a5d4f2a6 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 da869c7203b4..c08391345845 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -13,7 +13,7 @@ import StdNames.nme import Flags.{Module, Provisional} import dotty.tools.dotc.config.Config -object TypeApplications { +object TypeApplications: type TypeParamInfo = ParamInfo.Of[TypeName] @@ -148,8 +148,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. @@ -584,4 +588,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 d914fb8a3519..9c54ffce31ea 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2134,6 +2134,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 @@ -4374,10 +4377,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 = @@ -4390,7 +4393,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) @@ -7183,8 +7186,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 5af334d45c34..8afc134c4ddf 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -1897,9 +1897,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 6a185752bd650bbe23be28668b2664f537247ae8 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 1eba6c0b1bf8..09be5c70e133 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 5390626eb2cc..101758ca17e6 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 38c36487e3a3..f168f67b325c 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 9ed19c93d1ba..971ab9671cb5 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 5415a6e10609..3ccfb0948630 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 6dd85d730da8..f4c3cae58bd0 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 8749f7ddc10c..abada279b3b1 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 92c20afe7a73..c620347c6b75 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 96c8c4c4f845..9b57f3a7baec 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 bdb7a774ca51..95ada65c076f 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 c0c42bbdb32f..dc52059308aa 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 1a9d86c7d645..bf47268123ef 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 9f707c8bd2bb..339e5d72fe6c 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 00f5b578b4d1..113660176544 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 04d55475ec60..153753d4b496 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 9de714be8c37..6f35494b3491 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 386bae0f68c2..2d9d7c3e42a6 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 b44942d4e7ff..3b214c96a864 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 8566ad2a6799..d4e973421a4c 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 c8ede8bfdec2..019dad2c9a80 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 c08391345845..7d5c1d8b7cd1 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 @@ -25,7 +26,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 @@ -148,11 +149,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. @@ -309,7 +306,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 7f8f8a34c171..85b4084ede28 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 2e6fa7d94d43..03a8ed37a8cc 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 b7995b1ffba2..b9fa696236ed 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 cf03273b4805..b5ea097f9c5a 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 9c54ffce31ea..117154020ba2 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} @@ -2134,11 +2135,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 a1a4d56abb15..b3b74ec7d3a9 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 ad9d485b5ee5..6d160df040ff 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 e97e73dc5760..5f75521bff07 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 2b2f012c688c..38d5d1ef8216 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 59386dd9bd4d..49a1f03fcd9a 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 dc683aabe1e6..236700949d4c 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 d1164d4742af..3447233470aa 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 03bffc65fbc7..80ac4a9706c8 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 82701dafd2c9..4a0f21c02911 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 eb5e692b2915..f150874a9307 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 4d915b57df1b..70cc1652f338 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 11467e216aba..0fed1a0f6169 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 820651f0ce04..2462e4ddb668 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 7263bce0478c..a42a9be7327f 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 c743e757b8b4..58a6cd145a47 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 4288a82e0191..6926ff6283fb 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 0db1ddc5750c..16dd8c5f63df 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 dbb4c72ab311..7d56ed5f2ca9 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 9d72588dc326..91425a97a93e 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 491f3d3d2572..2bf62e84b5bc 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 76bc09e07540..229e60842307 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 b3285f62c062..bc00a1e59472 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 1b2d3e79c9a4..d8d9940d6978 100644 --- a/compiler/src/dotty/tools/dotc/transform/MixinOps.scala +++ b/compiler/src/dotty/tools/dotc/transform/MixinOps.scala @@ -3,6 +3,7 @@ package transform import core.* import Symbols.*, Types.*, Contexts.*, DenotTransformers.*, Flags.* +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 e2505144abda..de2e274733fb 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 9f79c063dc03..a8d0539211a7 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 51ccdfe57274..5eba4cfa99ad 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 c85f06e6075f..e4332eed7227 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 43aef6279cec..c0674cda22f6 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 fbff51acb514..bbcd4041a984 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 b43acce78d35..16a7070c62d0 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 92262d528487..3eac5936e92d 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 804150eafc4e..fd63c854df65 100644 --- a/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala +++ b/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala @@ -10,6 +10,7 @@ import dotty.tools.dotc.core.Contexts.* 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 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 50363759c542..a2e4451ebd55 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 13fcbe542448..9c5276f999a2 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 da6b20b75c29..77334b33180f 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.* @@ -27,7 +28,6 @@ import config.{Feature, MigrationVersion, SourceVersion} 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 ceec2392af1a..91c0876a9c12 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 14cc7bf963a6..568d3c697712 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 55778017b76f..4af7adf12530 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 fa5b1cbfe19e..894a38486946 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 c581dac5ec52..f89663510619 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 e86414cc2183..e30d208da8b4 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 0b6688c6f5fe..2a5bdf48f760 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 4e7c4336b852..1ab4a8156b1b 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 ed8919661860..c75924bd76fd 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 a79408b756ee..8bb916b25756 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 8df2fc1ed4b7..cdb9ab214889 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 f1ad0f8520f1..43f9d03d47b4 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 10a061ab8fc4..425a53ef031c 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 0c2929283ee3..7a914687dfe9 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 e3d5355eaffa..2114324bdadb 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 8afc134c4ddf..daad2590ee4d 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 @@ -1897,9 +1898,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 e7902ef8aa44..7260f1e18e28 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala @@ -24,6 +24,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 2ae4cd999229eb65af8522b3854f4a089c27c463 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 - .../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, 20 insertions(+), 126 deletions(-) diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala index 09be5c70e133..1eba6c0b1bf8 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 101758ca17e6..5390626eb2cc 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 f168f67b325c..38c36487e3a3 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 971ab9671cb5..9ed19c93d1ba 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 3ccfb0948630..5415a6e10609 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 f4c3cae58bd0..6dd85d730da8 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 abada279b3b1..8749f7ddc10c 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 c620347c6b75..92c20afe7a73 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 9b57f3a7baec..96c8c4c4f845 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 95ada65c076f..bdb7a774ca51 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 dc52059308aa..c0c42bbdb32f 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 bf47268123ef..1a9d86c7d645 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 339e5d72fe6c..9f707c8bd2bb 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 113660176544..00f5b578b4d1 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 153753d4b496..04d55475ec60 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 6f35494b3491..9de714be8c37 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 2d9d7c3e42a6..386bae0f68c2 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 3b214c96a864..b44942d4e7ff 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 d4e973421a4c..8566ad2a6799 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 019dad2c9a80..c8ede8bfdec2 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 7d5c1d8b7cd1..c08391345845 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 @@ -26,7 +25,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 @@ -149,7 +148,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. @@ -306,7 +309,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 85b4084ede28..7f8f8a34c171 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 03a8ed37a8cc..2e6fa7d94d43 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 b9fa696236ed..b7995b1ffba2 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 b5ea097f9c5a..cf03273b4805 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 117154020ba2..9c54ffce31ea 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} @@ -2135,7 +2134,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 b3b74ec7d3a9..a1a4d56abb15 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 6d160df040ff..ad9d485b5ee5 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 5f75521bff07..e97e73dc5760 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 38d5d1ef8216..2b2f012c688c 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 49a1f03fcd9a..59386dd9bd4d 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 236700949d4c..dc683aabe1e6 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 3447233470aa..d1164d4742af 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 80ac4a9706c8..03bffc65fbc7 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 4a0f21c02911..82701dafd2c9 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 f150874a9307..eb5e692b2915 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 70cc1652f338..4d915b57df1b 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 0fed1a0f6169..11467e216aba 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 2462e4ddb668..820651f0ce04 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 a42a9be7327f..7263bce0478c 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 58a6cd145a47..c743e757b8b4 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 6926ff6283fb..4288a82e0191 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 16dd8c5f63df..0db1ddc5750c 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 7d56ed5f2ca9..dbb4c72ab311 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 91425a97a93e..9d72588dc326 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 2bf62e84b5bc..491f3d3d2572 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 229e60842307..76bc09e07540 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 bc00a1e59472..b3285f62c062 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/MixinOps.scala b/compiler/src/dotty/tools/dotc/transform/MixinOps.scala index d8d9940d6978..1b2d3e79c9a4 100644 --- a/compiler/src/dotty/tools/dotc/transform/MixinOps.scala +++ b/compiler/src/dotty/tools/dotc/transform/MixinOps.scala @@ -3,7 +3,6 @@ package transform import core.* import Symbols.*, Types.*, Contexts.*, DenotTransformers.*, Flags.* -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 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 de2e274733fb..e2505144abda 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 a8d0539211a7..9f79c063dc03 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 5eba4cfa99ad..51ccdfe57274 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 e4332eed7227..c85f06e6075f 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 c0674cda22f6..43aef6279cec 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 bbcd4041a984..fbff51acb514 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 16a7070c62d0..b43acce78d35 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 3eac5936e92d..92262d528487 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/localopt/StringInterpolatorOpt.scala b/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala index fd63c854df65..804150eafc4e 100644 --- a/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala +++ b/compiler/src/dotty/tools/dotc/transform/localopt/StringInterpolatorOpt.scala @@ -10,7 +10,6 @@ import dotty.tools.dotc.core.Contexts.* 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 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 a2e4451ebd55..50363759c542 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 9c5276f999a2..13fcbe542448 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 77334b33180f..da6b20b75c29 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.* @@ -28,6 +27,7 @@ import config.{Feature, MigrationVersion, SourceVersion} 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 91c0876a9c12..ceec2392af1a 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 568d3c697712..14cc7bf963a6 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 4af7adf12530..55778017b76f 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 894a38486946..fa5b1cbfe19e 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 f89663510619..c581dac5ec52 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 e30d208da8b4..e86414cc2183 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 2a5bdf48f760..0b6688c6f5fe 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 1ab4a8156b1b..4e7c4336b852 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 c75924bd76fd..ed8919661860 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 8bb916b25756..a79408b756ee 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 cdb9ab214889..8df2fc1ed4b7 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 43f9d03d47b4..f1ad0f8520f1 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 425a53ef031c..10a061ab8fc4 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 7a914687dfe9..0c2929283ee3 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 2114324bdadb..e3d5355eaffa 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 daad2590ee4d..8afc134c4ddf 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 @@ -1898,9 +1897,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 7260f1e18e28..e7902ef8aa44 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala @@ -24,7 +24,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 e82ad98d02c03ff320092b8b02a7ffe3a7408fcf 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 c08391345845..d4ba9eec9088 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -150,10 +150,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 9c54ffce31ea..5a5a09e0c226 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -2134,11 +2134,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 8afc134c4ddf..6111e3f993e4 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -1897,9 +1897,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)