From 1d48e539f999238bd4ba3c0afb1f48042659fed3 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Wed, 15 Jan 2025 19:59:36 -0800 Subject: [PATCH 1/2] Rewrite imports --- .../src/dotty/tools/MainGenericCompiler.scala | 9 -------- .../tools/backend/jvm/BCodeBodyBuilder.scala | 2 +- .../tools/backend/jvm/BCodeHelpers.scala | 4 +--- .../tools/backend/jvm/BCodeIdiomatic.scala | 2 +- .../tools/backend/jvm/BCodeSkelBuilder.scala | 2 +- .../tools/backend/jvm/BTypesFromSymbols.scala | 3 --- .../tools/backend/jvm/BackendUtils.scala | 2 -- .../tools/backend/jvm/ClassfileWriters.scala | 4 +--- .../src/dotty/tools/backend/jvm/CodeGen.scala | 5 ----- .../dotty/tools/backend/jvm/CoreBTypes.scala | 3 --- .../backend/jvm/DottyBackendInterface.scala | 1 - .../dotty/tools/backend/jvm/GenBCode.scala | 3 --- .../backend/jvm/GenericSignatureVisitor.scala | 2 +- .../tools/backend/jvm/PostProcessor.scala | 3 +-- .../jvm/PostProcessorFrontendAccess.scala | 4 +--- .../dotty/tools/backend/sjs/JSPositions.scala | 1 - .../dotty/tools/dotc/CompilationUnit.scala | 1 - compiler/src/dotty/tools/dotc/Driver.scala | 1 - compiler/src/dotty/tools/dotc/Run.scala | 6 +---- .../src/dotty/tools/dotc/ast/Desugar.scala | 4 +--- .../dotty/tools/dotc/ast/DesugarEnums.scala | 1 - .../dotty/tools/dotc/ast/MainProxies.scala | 8 ++----- .../src/dotty/tools/dotc/ast/TreeInfo.scala | 1 - .../dotty/tools/dotc/ast/TreeTypeMap.scala | 2 +- compiler/src/dotty/tools/dotc/ast/tpd.scala | 3 +-- .../tools/dotc/cc/CaptureAnnotation.scala | 3 --- .../src/dotty/tools/dotc/cc/CaptureOps.scala | 5 ++--- .../src/dotty/tools/dotc/cc/CaptureRef.scala | 7 ++---- .../src/dotty/tools/dotc/cc/CaptureSet.scala | 5 +---- .../dotty/tools/dotc/cc/CapturingType.scala | 1 - .../dotty/tools/dotc/cc/CheckCaptures.scala | 11 +++++----- .../src/dotty/tools/dotc/cc/Existential.scala | 5 +---- .../dotty/tools/dotc/cc/RetainingType.scala | 1 - compiler/src/dotty/tools/dotc/cc/Setup.scala | 7 +++--- .../dotc/classpath/DirectoryClassPath.scala | 2 +- .../classpath/VirtualDirectoryClassPath.scala | 2 +- .../ZipAndJarFileLookupFactory.scala | 2 +- .../src/dotty/tools/dotc/config/Feature.scala | 3 +-- .../tools/dotc/config/ScalaSettings.scala | 2 +- .../dotc/config/ScalaSettingsProperties.scala | 2 +- .../tools/dotc/core/CompilationUnitInfo.scala | 1 - .../dotty/tools/dotc/core/Constraint.scala | 1 - .../tools/dotc/core/ConstraintHandling.scala | 1 - .../src/dotty/tools/dotc/core/Contexts.scala | 2 -- .../dotty/tools/dotc/core/Decorators.scala | 2 +- .../dotty/tools/dotc/core/Definitions.scala | 10 +++------ .../dotty/tools/dotc/core/Denotations.scala | 1 - .../tools/dotc/core/GadtConstraint.scala | 4 +--- .../dotty/tools/dotc/core/MatchTypes.scala | 2 +- .../src/dotty/tools/dotc/core/NameOps.scala | 1 - .../src/dotty/tools/dotc/core/Phases.scala | 1 - .../src/dotty/tools/dotc/core/Scopes.scala | 1 - .../tools/dotc/core/SymDenotations.scala | 4 ++-- .../dotty/tools/dotc/core/SymbolLoaders.scala | 3 +-- .../src/dotty/tools/dotc/core/Symbols.scala | 1 - .../src/dotty/tools/dotc/core/TastyInfo.scala | 1 - .../tools/dotc/core/TypeApplications.scala | 3 +-- .../dotty/tools/dotc/core/TypeComparer.scala | 3 +-- .../dotty/tools/dotc/core/TypeErrors.scala | 1 - .../src/dotty/tools/dotc/core/TypeOps.scala | 4 +--- .../src/dotty/tools/dotc/core/TypeUtils.scala | 2 +- .../src/dotty/tools/dotc/core/Types.scala | 5 ++--- .../src/dotty/tools/dotc/core/Variances.scala | 2 +- .../dotc/core/classfile/ClassfileParser.scala | 4 +--- .../classfile/ClassfileTastyUUIDParser.scala | 1 - .../dotc/core/tasty/AttributePickler.scala | 1 - .../dotc/core/tasty/AttributeUnpickler.scala | 3 +-- .../tools/dotc/core/tasty/Attributes.scala | 1 - .../dotc/core/tasty/CommentPickler.scala | 1 - .../dotc/core/tasty/CommentUnpickler.scala | 1 - .../dotc/core/tasty/PositionPickler.scala | 2 +- .../tools/dotc/core/tasty/ScratchData.scala | 1 - .../dotc/core/tasty/TastyClassName.scala | 1 - .../tools/dotc/core/tasty/TastyPrinter.scala | 5 ----- .../dotc/core/tasty/TastyUnpickler.scala | 1 - .../tools/dotc/core/tasty/TreePickler.scala | 3 +-- .../tools/dotc/core/tasty/TreeUnpickler.scala | 1 - .../core/unpickleScala2/Scala2Erasure.scala | 2 +- .../core/unpickleScala2/Scala2Unpickler.scala | 2 +- .../tools/dotc/fromtasty/ReadTasty.scala | 1 - .../tools/dotc/inlines/InlineReducer.scala | 4 ++-- .../dotty/tools/dotc/inlines/Inliner.scala | 1 - .../dotty/tools/dotc/inlines/Inlines.scala | 4 +--- .../dotc/inlines/PrepareInlineable.scala | 3 --- .../tools/dotc/interactive/Completion.scala | 5 ----- .../tools/dotc/interactive/Interactive.scala | 2 +- .../dotc/interactive/InteractiveDriver.scala | 2 -- .../dotty/tools/dotc/parsing/Parsers.scala | 3 +-- .../dotty/tools/dotc/parsing/Scanners.scala | 5 ++--- .../dotc/parsing/xml/MarkupParsers.scala | 1 - .../dotty/tools/dotc/plugins/Plugins.scala | 2 +- .../tools/dotc/printing/Formatting.scala | 4 +--- .../tools/dotc/printing/OutlinePrinter.scala | 1 - .../tools/dotc/printing/RefinedPrinter.scala | 4 ++-- .../tools/dotc/profile/ChromeTrace.scala | 3 +-- .../dotty/tools/dotc/profile/Profiler.scala | 1 - .../dotty/tools/dotc/quoted/Interpreter.scala | 5 ----- .../tools/dotc/quoted/QuotePatterns.scala | 5 ----- compiler/src/dotty/tools/dotc/report.scala | 5 ++--- .../tools/dotc/reporting/DidYouMean.scala | 4 ++-- .../dotty/tools/dotc/reporting/Profile.scala | 5 +---- .../dotty/tools/dotc/reporting/Reporter.scala | 1 - .../dotty/tools/dotc/reporting/WConf.scala | 1 - .../dotty/tools/dotc/reporting/messages.scala | 3 +-- .../src/dotty/tools/dotc/sbt/ExtractAPI.scala | 2 -- .../tools/dotc/sbt/ExtractDependencies.scala | 7 ++---- .../src/dotty/tools/dotc/sbt/package.scala | 1 - .../tools/dotc/semanticdb/DiagnosticOps.scala | 1 - .../dotc/semanticdb/ExtractSemanticDB.scala | 1 - .../dotty/tools/dotc/semanticdb/TypeOps.scala | 3 +-- .../dotc/semanticdb/generated/Language.scala | 1 - .../dotc/semanticdb/generated/Schema.scala | 1 - .../tools/dotc/staging/CrossStageSafety.scala | 2 -- .../dotty/tools/dotc/staging/HealType.scala | 1 - .../tools/dotc/staging/QuoteTypeTags.scala | 2 -- .../tools/dotc/staging/StagingLevel.scala | 5 ----- .../dotc/staging/TreeMapWithStages.scala | 1 - .../tools/dotc/transform/AccessProxies.scala | 1 - .../tools/dotc/transform/ArrayApply.scala | 3 +-- .../tools/dotc/transform/CapturedVars.scala | 4 ---- .../transform/CheckLoopingImplicits.scala | 2 +- .../dotc/transform/CheckNoSuperThis.scala | 2 +- .../tools/dotc/transform/CheckShadowing.scala | 22 ------------------- .../tools/dotc/transform/CheckUnused.scala | 14 +----------- .../tools/dotc/transform/Constructors.scala | 1 - .../transform/ContextFunctionResults.scala | 1 - .../tools/dotc/transform/DropBreaks.scala | 4 +--- .../dotc/transform/DropOuterAccessors.scala | 1 - .../transform/DropParentRefinements.scala | 1 - .../dotc/transform/ElimErasedValueType.scala | 4 ++-- .../dotc/transform/ElimPackagePrefixes.scala | 2 +- .../dotc/transform/ElimPolyFunction.scala | 7 +++--- .../dotty/tools/dotc/transform/Erasure.scala | 1 - .../tools/dotc/transform/EtaReduce.scala | 2 +- .../tools/dotc/transform/ExpandPrivate.scala | 1 - .../tools/dotc/transform/ExpandSAMs.scala | 4 +--- .../tools/dotc/transform/FirstTransform.scala | 1 - .../dotc/transform/ForwardDepChecks.scala | 2 +- .../dotc/transform/GenericSignatures.scala | 3 --- .../tools/dotc/transform/HoistSuperArgs.scala | 1 - .../tools/dotc/transform/InlinePatterns.scala | 2 +- .../dotty/tools/dotc/transform/Inlining.scala | 5 ----- .../dotc/transform/InstrumentCoverage.scala | 1 - .../dotty/tools/dotc/transform/LazyVals.scala | 3 --- .../tools/dotc/transform/LetOverApply.scala | 2 +- .../dotc/transform/MacroAnnotations.scala | 2 -- .../tools/dotc/transform/MegaPhase.scala | 2 +- .../dotty/tools/dotc/transform/Memoize.scala | 1 - .../dotc/transform/NonLocalReturns.scala | 1 - .../dotc/transform/OverridingPairs.scala | 2 +- .../tools/dotc/transform/PickleQuotes.scala | 4 ---- .../dotty/tools/dotc/transform/Pickler.scala | 5 ++--- .../tools/dotc/transform/PostTyper.scala | 7 +++--- .../tools/dotc/transform/PreRecheck.scala | 2 +- .../dotc/transform/PruneErasedDefs.scala | 1 - .../tools/dotc/transform/PureStats.scala | 6 ++--- .../dotty/tools/dotc/transform/Recheck.scala | 4 +--- .../tools/dotc/transform/ReifiedReflect.scala | 8 ------- .../tools/dotc/transform/ResolveSuper.scala | 1 - .../transform/SpecializeApplyMethods.scala | 6 ++--- .../dotc/transform/SpecializeFunctions.scala | 4 ++-- .../dotc/transform/SpecializeTuples.scala | 4 ++-- .../dotty/tools/dotc/transform/Splicer.scala | 7 ------ .../dotty/tools/dotc/transform/Splicing.scala | 7 ------ .../tools/dotc/transform/SuperAccessors.scala | 2 +- .../tools/dotc/transform/TypeTestsCasts.scala | 2 -- .../dotc/transform/VCElideAllocations.scala | 2 +- .../tools/dotc/transform/init/Checker.scala | 2 -- .../tools/dotc/transform/init/Errors.scala | 2 +- .../tools/dotc/transform/init/Objects.scala | 1 - .../tools/dotc/transform/patmat/Space.scala | 3 +-- .../dotc/transform/sjs/PrepJSInterop.scala | 2 +- .../dotty/tools/dotc/typer/Applications.scala | 1 - .../src/dotty/tools/dotc/typer/Checking.scala | 3 +-- .../tools/dotc/typer/CrossVersionChecks.scala | 2 +- .../src/dotty/tools/dotc/typer/Deriving.scala | 2 +- .../dotty/tools/dotc/typer/Docstrings.scala | 2 +- .../src/dotty/tools/dotc/typer/Dynamic.scala | 1 - .../tools/dotc/typer/ErrorReporting.scala | 2 -- .../dotty/tools/dotc/typer/Implicits.scala | 2 -- .../dotty/tools/dotc/typer/ImportInfo.scala | 2 +- .../dotty/tools/dotc/typer/Inferencing.scala | 3 +-- .../dotty/tools/dotc/typer/Migrations.scala | 2 +- .../src/dotty/tools/dotc/typer/Namer.scala | 3 +-- .../tools/dotc/typer/QuotesAndSplices.scala | 5 ----- .../src/dotty/tools/dotc/typer/ReTyper.scala | 1 - .../dotty/tools/dotc/typer/RefChecks.scala | 4 ++-- .../dotty/tools/dotc/typer/Synthesizer.scala | 2 -- .../dotty/tools/dotc/typer/TypeAssigner.scala | 3 +-- .../src/dotty/tools/dotc/typer/Typer.scala | 3 +-- .../src/dotty/tools/dotc/util/EqHashSet.scala | 1 - .../src/dotty/tools/dotc/util/HashSet.scala | 1 - .../dotty/tools/dotc/util/Signatures.scala | 3 +-- .../dotty/tools/dotc/util/SourceFile.scala | 3 --- .../dotty/tools/dotc/util/concurrent.scala | 2 +- .../src/dotty/tools/io/FileExtension.scala | 1 - compiler/src/dotty/tools/io/FileWriters.scala | 3 --- compiler/src/dotty/tools/repl/Rendering.scala | 2 +- .../dotty/tools/runner/ScalaClassLoader.scala | 1 - .../BestEffortTastyHeaderUnpickler.scala | 4 ++-- .../runtime/impl/ExprCastException.scala | 2 -- .../quoted/runtime/impl/QuoteMatcher.scala | 1 - .../quoted/runtime/impl/QuotesImpl.scala | 3 --- library/src/scala/CanThrow.scala | 2 +- library/src/scala/NamedTuple.scala | 1 - library/src/scala/Tuple.scala | 1 - library/src/scala/compiletime/package.scala | 2 +- library/src/scala/quoted/Type.scala | 2 +- library/src/scala/quoted/runtime/Expr.scala | 2 +- .../src/scala/runtime/coverage/Invoker.scala | 1 - library/src/scala/util/FromDigits.scala | 1 - 211 files changed, 138 insertions(+), 455 deletions(-) diff --git a/compiler/src/dotty/tools/MainGenericCompiler.scala b/compiler/src/dotty/tools/MainGenericCompiler.scala index aa924a237f73..0aa163a50b3c 100644 --- a/compiler/src/dotty/tools/MainGenericCompiler.scala +++ b/compiler/src/dotty/tools/MainGenericCompiler.scala @@ -6,16 +6,7 @@ import scala.annotation.tailrec import scala.io.Source import scala.util.Try import java.io.File -import java.lang.Thread import scala.annotation.internal.sharable -import dotty.tools.dotc.util.ClasspathFromClassloader -import dotty.tools.runner.ObjectRunner -import dotty.tools.dotc.config.Properties.envOrNone -import dotty.tools.io.Jar -import dotty.tools.runner.ScalaClassLoader -import java.nio.file.Paths -import dotty.tools.dotc.config.CommandLineParser -import dotty.tools.scripting.StringDriver enum CompileMode: case Guess diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala index 35b24ab57b00..6928c214f59a 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala @@ -8,7 +8,7 @@ import scala.annotation.{switch, tailrec} import scala.collection.mutable.SortedMap import scala.tools.asm -import scala.tools.asm.{Handle, Opcodes} +import scala.tools.asm.Opcodes import BCodeHelpers.InvokeStyle import dotty.tools.dotc.ast.tpd diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala b/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala index f8866f40d9d4..248fa60c155f 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala @@ -31,7 +31,6 @@ import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.core.TypeErasure import dotty.tools.dotc.transform.GenericSignatures import dotty.tools.dotc.transform.ElimErasedValueType -import dotty.tools.io.AbstractFile import dotty.tools.dotc.report import dotty.tools.backend.jvm.DottyBackendInterface.symExtensions @@ -49,7 +48,7 @@ trait BCodeHelpers extends BCodeIdiomatic { import bTypes.* import tpd.* import coreBTypes.* - import int.{_, given} + import int.given import DottyBackendInterface.* // We need to access GenBCode phase to get access to post-processor components. @@ -380,7 +379,6 @@ trait BCodeHelpers extends BCodeIdiomatic { } // end of trait BCAnnotGen trait BCJGenSigGen { - import int.given def getCurrentCUnit(): CompilationUnit diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala index 9938b7415da7..2277dc109774 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala @@ -21,7 +21,7 @@ trait BCodeIdiomatic { val int: DottyBackendInterface val bTypes: BTypesFromSymbols[int.type] - import int.{_, given} + import int.given import bTypes.* import coreBTypes.* diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala index e632def24700..21323d271bb2 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala @@ -29,7 +29,7 @@ import dotty.tools.dotc.report * */ trait BCodeSkelBuilder extends BCodeHelpers { - import int.{_, given} + import int.given import DottyBackendInterface.{symExtensions, _} import tpd.* import bTypes.* diff --git a/compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala b/compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala index 97934935f352..07360692cfa6 100644 --- a/compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala +++ b/compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala @@ -4,8 +4,6 @@ package jvm import scala.tools.asm import scala.annotation.threadUnsafe -import scala.collection.mutable -import scala.collection.mutable.Clearable import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Contexts.* @@ -14,7 +12,6 @@ import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Phases.Phase import dotty.tools.dotc.core.StdNames -import dotty.tools.dotc.core.Phases /** * This class mainly contains the method classBTypeFromSymbol, which extracts the necessary diff --git a/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala b/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala index ae423b6b80dd..c7c6e219b76a 100644 --- a/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala +++ b/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala @@ -6,7 +6,6 @@ import scala.tools.asm.tree.InvokeDynamicInsnNode import asm.tree.ClassNode import scala.collection.mutable import scala.jdk.CollectionConverters.* -import dotty.tools.dotc.report import scala.language.unsafeNulls @@ -76,7 +75,6 @@ class BackendUtils(val postProcessor: PostProcessor) { */ def addLambdaDeserialize(classNode: ClassNode, implMethodsArray: Array[Handle]): Unit = { import asm.Opcodes.* - import bTypes.* import coreBTypes.* val cw = classNode diff --git a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala index e2730c1e84ab..1db989c2f17b 100644 --- a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala +++ b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala @@ -3,16 +3,14 @@ package dotty.tools.backend.jvm import java.io.{DataOutputStream, File, IOException, BufferedOutputStream, FileOutputStream} import java.nio.ByteBuffer import java.nio.channels.{ClosedByInterruptException, FileChannel} -import java.nio.charset.StandardCharsets.UTF_8 import java.nio.file.* import java.nio.file.attribute.FileAttribute import java.util import java.util.concurrent.ConcurrentHashMap import java.util.zip.{CRC32, Deflater, ZipEntry, ZipOutputStream} -import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.em -import dotty.tools.io.{AbstractFile, PlainFile, VirtualFile} +import dotty.tools.io.{AbstractFile, PlainFile} import dotty.tools.io.PlainFile.toPlainFile import BTypes.InternalName import scala.util.chaining.* diff --git a/compiler/src/dotty/tools/backend/jvm/CodeGen.scala b/compiler/src/dotty/tools/backend/jvm/CodeGen.scala index d4843cd56639..ba68364eb47e 100644 --- a/compiler/src/dotty/tools/backend/jvm/CodeGen.scala +++ b/compiler/src/dotty/tools/backend/jvm/CodeGen.scala @@ -5,10 +5,8 @@ import scala.language.unsafeNulls import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.ast.Trees.{PackageDef, ValDef} import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.core.Phases.Phase import scala.collection.mutable -import scala.jdk.CollectionConverters.* import dotty.tools.dotc.interfaces import dotty.tools.dotc.report @@ -21,13 +19,10 @@ import Phases.* import Symbols.* import StdNames.nme -import java.io.DataOutputStream -import java.nio.channels.ClosedByInterruptException import dotty.tools.tasty.{ TastyBuffer, TastyHeaderUnpickler } import dotty.tools.dotc.core.tasty.TastyUnpickler -import scala.tools.asm import scala.tools.asm.tree.* import tpd.* import dotty.tools.io.AbstractFile diff --git a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala index e0ddd055fccb..d5f32ccaafdb 100644 --- a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala +++ b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala @@ -6,8 +6,6 @@ package jvm import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.transform.Erasure import scala.tools.asm.{Handle, Opcodes} -import dotty.tools.dotc.core.StdNames -import BTypes.InternalName import PostProcessorFrontendAccess.Lazy abstract class CoreBTypes { @@ -58,7 +56,6 @@ abstract class CoreBTypesFromSymbols[I <: DottyBackendInterface] extends CoreBTy import bTypes.* import DottyBackendInterface.* - import dotty.tools.dotc.core.Contexts.Context import frontendAccess.perRunLazy /** * Maps primitive types to their corresponding PrimitiveBType. The map is defined lexically above diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index cab17b31c3f3..1e087db31afe 100644 --- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.core.Flags.* import java.io.{File => _} import scala.reflect.ClassTag -import dotty.tools.io.AbstractFile import dotty.tools.dotc.core.* import Contexts.* import Types.* diff --git a/compiler/src/dotty/tools/backend/jvm/GenBCode.scala b/compiler/src/dotty/tools/backend/jvm/GenBCode.scala index 58daa01e4bdf..57c9210c66bc 100644 --- a/compiler/src/dotty/tools/backend/jvm/GenBCode.scala +++ b/compiler/src/dotty/tools/backend/jvm/GenBCode.scala @@ -10,10 +10,7 @@ import Symbols.* import dotty.tools.io.* import scala.collection.mutable import scala.compiletime.uninitialized -import java.util.concurrent.TimeoutException -import scala.concurrent.duration.Duration -import scala.concurrent.Await class GenBCode extends Phase { self => diff --git a/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala b/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala index 00d7dc598509..6aec30a8b369 100644 --- a/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala +++ b/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala @@ -2,7 +2,7 @@ package dotty.tools.backend.jvm import scala.language.unsafeNulls -import scala.tools.asm.{ClassReader, Type, Handle } +import scala.tools.asm.{Type, Handle } import scala.tools.asm.tree.* import scala.collection.mutable diff --git a/compiler/src/dotty/tools/backend/jvm/PostProcessor.scala b/compiler/src/dotty/tools/backend/jvm/PostProcessor.scala index 9f172806a3b5..03fceadad8d6 100644 --- a/compiler/src/dotty/tools/backend/jvm/PostProcessor.scala +++ b/compiler/src/dotty/tools/backend/jvm/PostProcessor.scala @@ -2,8 +2,7 @@ package dotty.tools.backend.jvm import java.util.concurrent.ConcurrentHashMap -import scala.collection.mutable.ListBuffer -import dotty.tools.dotc.util.{SourcePosition, NoSourcePosition} +import dotty.tools.dotc.util.SourcePosition import dotty.tools.io.AbstractFile import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.em diff --git a/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala b/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala index e1b2120fa848..836cca9db991 100644 --- a/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala +++ b/compiler/src/dotty/tools/backend/jvm/PostProcessorFrontendAccess.scala @@ -1,13 +1,11 @@ package dotty.tools.backend.jvm -import scala.collection.mutable.{Clearable, HashSet} +import scala.collection.mutable.HashSet import dotty.tools.dotc.util.* import dotty.tools.dotc.reporting.Message import dotty.tools.io.AbstractFile -import java.util.{Collection => JCollection, Map => JMap} import dotty.tools.dotc.core.Contexts.Context import dotty.tools.dotc.report -import dotty.tools.dotc.core.Phases import scala.compiletime.uninitialized /** diff --git a/compiler/src/dotty/tools/backend/sjs/JSPositions.scala b/compiler/src/dotty/tools/backend/sjs/JSPositions.scala index a229c9ea0e58..d1af61b1ae48 100644 --- a/compiler/src/dotty/tools/backend/sjs/JSPositions.scala +++ b/compiler/src/dotty/tools/backend/sjs/JSPositions.scala @@ -64,7 +64,6 @@ class JSPositions()(using Context) { sourceAndSpan2irPos(sourcePos.source, sourcePos.span) private object span2irPosCache { - import dotty.tools.dotc.util.* private var lastDotcSource: SourceFile = null private var lastIRSource: ir.Position.SourceFile = null diff --git a/compiler/src/dotty/tools/dotc/CompilationUnit.scala b/compiler/src/dotty/tools/dotc/CompilationUnit.scala index 0d755797d026..1b1772b56cff 100644 --- a/compiler/src/dotty/tools/dotc/CompilationUnit.scala +++ b/compiler/src/dotty/tools/dotc/CompilationUnit.scala @@ -14,7 +14,6 @@ import ast.Trees.{Import, Ident} import typer.Nullables import core.Decorators.* import config.{SourceVersion, Feature} -import StdNames.nme import scala.annotation.internal.sharable import scala.util.control.NoStackTrace import transform.MacroAnnotations.isMacroAnnotation diff --git a/compiler/src/dotty/tools/dotc/Driver.scala b/compiler/src/dotty/tools/dotc/Driver.scala index 98abe2ac6c38..a9c25d0caa7a 100644 --- a/compiler/src/dotty/tools/dotc/Driver.scala +++ b/compiler/src/dotty/tools/dotc/Driver.scala @@ -9,7 +9,6 @@ import dotty.tools.dotc.ast.Positioned import dotty.tools.io.{AbstractFile, FileExtension} import reporting.* import core.Decorators.* -import config.Feature import scala.util.control.NonFatal import fromtasty.{TASTYCompiler, TastyFileUtil} diff --git a/compiler/src/dotty/tools/dotc/Run.scala b/compiler/src/dotty/tools/dotc/Run.scala index 50fd668c7696..acd56a9ceea1 100644 --- a/compiler/src/dotty/tools/dotc/Run.scala +++ b/compiler/src/dotty/tools/dotc/Run.scala @@ -12,7 +12,7 @@ import typer.Typer import typer.ImportInfo.withRootImports import Decorators.* import io.AbstractFile -import Phases.{unfusedPhases, Phase} +import Phases.Phase import sbt.interfaces.ProgressCallback @@ -22,17 +22,13 @@ import reporting.Diagnostic import reporting.Diagnostic.Warning import rewrites.Rewrites import profile.Profiler -import printing.XprintMode import typer.ImplicitRunInfo import config.Feature import StdNames.nme -import java.io.{BufferedWriter, OutputStreamWriter} -import java.nio.charset.StandardCharsets import scala.collection.mutable import scala.util.control.NonFatal -import scala.io.Codec import Run.Progress import scala.compiletime.uninitialized diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 4ddd0006dc26..3dd2518d1a56 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -6,12 +6,11 @@ import core.* import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, NameOps.*, Flags.* import Symbols.*, StdNames.*, Trees.*, ContextOps.* import Decorators.* -import Annotations.Annotation import NameKinds.{UniqueName, ContextBoundParamName, ContextFunctionParamName, DefaultGetterName, WildcardParamName} import typer.{Namer, Checking} import util.{Property, SourceFile, SourcePosition, SrcPos, Chars} import config.{Feature, Config} -import config.Feature.{sourceVersion, migrateTo3, enabled, betterForsEnabled} +import config.Feature.betterForsEnabled import config.SourceVersion.* import collection.mutable import reporting.* @@ -21,7 +20,6 @@ import config.Printers import parsing.Parsers import scala.annotation.internal.sharable -import scala.annotation.threadUnsafe object desugar { import untpd.* diff --git a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala index 7268ec720ce2..6d4985b24b05 100644 --- a/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala +++ b/compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala @@ -10,7 +10,6 @@ import util.{Property, SourceFile} import typer.ErrorReporting.* import transform.SyntheticMembers.ExtendsSingletonMirror -import scala.annotation.internal.sharable /** Helper methods to desugar enums */ object DesugarEnums { diff --git a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala index 7bf83d548c97..bee3efe7345d 100644 --- a/compiler/src/dotty/tools/dotc/ast/MainProxies.scala +++ b/compiler/src/dotty/tools/dotc/ast/MainProxies.scala @@ -2,13 +2,9 @@ package dotty.tools.dotc package ast import core.* -import Symbols.*, Types.*, Contexts.*, Decorators.*, util.Spans.*, Flags.*, Constants.* -import StdNames.{nme, tpnme} +import Symbols.*, Types.*, Contexts.*, Decorators.*, Flags.*, Constants.* +import StdNames.nme import ast.Trees.* -import Names.Name -import Comments.Comment -import NameKinds.DefaultGetterName -import Annotations.Annotation object MainProxies { diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index e0fe17755257..abb0b463451c 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -5,7 +5,6 @@ package ast import core.* import Flags.*, Trees.*, Types.*, Contexts.* import Names.*, StdNames.*, NameOps.*, Symbols.* -import Annotations.Annotation import NameKinds.ContextBoundParamName import typer.ConstFold import reporting.trace diff --git a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala index 98d9a0ca85f6..6bb3a9d18d88 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala @@ -4,7 +4,7 @@ package ast import core.* import Types.*, Contexts.*, Flags.* -import Symbols.*, Annotations.*, Trees.*, Symbols.*, Constants.Constant +import Annotations.*, Trees.*, Symbols.*, Constants.Constant import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala index 77e3387c5ce0..7cbb7b9d79b9 100644 --- a/compiler/src/dotty/tools/dotc/ast/tpd.scala +++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala @@ -5,9 +5,8 @@ package ast import dotty.tools.dotc.transform.{ExplicitOuter, Erasure} import typer.ProtoTypes import core.* -import Scopes.newScope import util.Spans.*, Types.*, Contexts.*, Constants.*, Names.*, Flags.*, NameOps.* -import Symbols.*, StdNames.*, Annotations.*, Trees.*, Symbols.* +import StdNames.*, Annotations.*, Trees.*, Symbols.* import Decorators.*, DenotTransformers.* import collection.{immutable, mutable} import util.{Property, SourceFile} diff --git a/compiler/src/dotty/tools/dotc/cc/CaptureAnnotation.scala b/compiler/src/dotty/tools/dotc/cc/CaptureAnnotation.scala index f0018cc93d7e..375807f0991a 100644 --- a/compiler/src/dotty/tools/dotc/cc/CaptureAnnotation.scala +++ b/compiler/src/dotty/tools/dotc/cc/CaptureAnnotation.scala @@ -4,10 +4,8 @@ package cc import core.* import Types.*, Symbols.*, Contexts.*, Annotations.* -import ast.Trees.* import ast.{tpd, untpd} import Decorators.* -import config.Printers.capt import printing.Printer import printing.Texts.Text @@ -21,7 +19,6 @@ import printing.Texts.Text * @param cls the underlying class (either annotation.retains or annotation.retainsByName) */ case class CaptureAnnotation(refs: CaptureSet, boxed: Boolean)(cls: Symbol) extends Annotation: - import CaptureAnnotation.* import tpd.* /** A cache for the version of this annotation which differs in its boxed status. */ diff --git a/compiler/src/dotty/tools/dotc/cc/CaptureOps.scala b/compiler/src/dotty/tools/dotc/cc/CaptureOps.scala index 92cd40a65d5a..2dfbc69fc1c9 100644 --- a/compiler/src/dotty/tools/dotc/cc/CaptureOps.scala +++ b/compiler/src/dotty/tools/dotc/cc/CaptureOps.scala @@ -5,13 +5,12 @@ package cc import core.* import Types.*, Symbols.*, Contexts.*, Annotations.*, Flags.* import Names.TermName -import ast.{tpd, untpd} -import Decorators.*, NameOps.* +import ast.tpd +import Decorators.* import config.SourceVersion import config.Printers.capt import util.Property.Key import tpd.* -import StdNames.nme import config.Feature import collection.mutable import CCState.* diff --git a/compiler/src/dotty/tools/dotc/cc/CaptureRef.scala b/compiler/src/dotty/tools/dotc/cc/CaptureRef.scala index e5beb56c6c56..5978cbc858ff 100644 --- a/compiler/src/dotty/tools/dotc/cc/CaptureRef.scala +++ b/compiler/src/dotty/tools/dotc/cc/CaptureRef.scala @@ -3,12 +3,9 @@ package dotc package cc import core.* -import Types.*, Symbols.*, Contexts.*, Decorators.* -import util.{SimpleIdentitySet, Property} -import typer.ErrorReporting.Addenda +import Types.*, Symbols.*, Contexts.* +import util.SimpleIdentitySet import TypeComparer.subsumesExistentially -import util.common.alwaysTrue -import scala.collection.mutable import CCState.* import Periods.NoRunId import compiletime.uninitialized diff --git a/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala b/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala index 7f4a34bab1f9..f5579539c5e1 100644 --- a/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala +++ b/compiler/src/dotty/tools/dotc/cc/CaptureSet.scala @@ -3,10 +3,9 @@ package dotc package cc import core.* -import Types.*, Symbols.*, Flags.*, Contexts.*, Decorators.* +import Types.*, Symbols.*, Contexts.*, Decorators.* import config.Printers.{capt, captDebug} import Annotations.Annotation -import annotation.threadUnsafe import annotation.constructorOnly import annotation.internal.sharable import reporting.trace @@ -14,8 +13,6 @@ import printing.{Showable, Printer} import printing.Texts.* import util.{SimpleIdentitySet, Property} import typer.ErrorReporting.Addenda -import TypeComparer.subsumesExistentially -import util.common.alwaysTrue import scala.collection.{mutable, immutable} import CCState.* diff --git a/compiler/src/dotty/tools/dotc/cc/CapturingType.scala b/compiler/src/dotty/tools/dotc/cc/CapturingType.scala index 9f9b923b2c88..73b86d2c4986 100644 --- a/compiler/src/dotty/tools/dotc/cc/CapturingType.scala +++ b/compiler/src/dotty/tools/dotc/cc/CapturingType.scala @@ -4,7 +4,6 @@ package cc import core.* import Types.*, Symbols.*, Contexts.* -import Decorators.i /** A (possibly boxed) capturing type. This is internally represented as an annotated type with a @retains * or @retainsByName annotation, but the extractor will succeed only at phase CheckCaptures. diff --git a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala index 830d9ad0a4d4..6058cd72422e 100644 --- a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala +++ b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala @@ -3,20 +3,19 @@ package dotc package cc import core.* -import Phases.*, DenotTransformers.*, SymDenotations.* +import DenotTransformers.* import Contexts.*, Names.*, Flags.*, Symbols.*, Decorators.* import Types.*, StdNames.*, Denotations.* import config.Printers.{capt, recheckr, noPrinter} -import config.{Config, Feature} -import ast.{tpd, untpd, Trees} +import config.Feature +import ast.{tpd, Trees} import Trees.* import typer.RefChecks.{checkAllOverrides, checkSelfAgainstParents, OverridingPairsChecker} import typer.Checking.{checkBounds, checkAppliedTypesIn} import typer.ErrorReporting.{Addenda, NothingToAdd, err} import typer.ProtoTypes.{LhsProto, WildcardSelectionProto} -import util.{SimpleIdentitySet, EqHashMap, EqHashSet, SrcPos, Property} -import transform.{Recheck, PreRecheck, CapturedVars} -import Recheck.* +import util.{SimpleIdentitySet, EqHashMap, EqHashSet, SrcPos} +import transform.Recheck import scala.collection.mutable import CaptureSet.{withCaptureSetsExplained, IdempotentCaptRefMap, CompareResult} import CCState.* diff --git a/compiler/src/dotty/tools/dotc/cc/Existential.scala b/compiler/src/dotty/tools/dotc/cc/Existential.scala index ea979e0b9f7f..d73fc579d350 100644 --- a/compiler/src/dotty/tools/dotc/cc/Existential.scala +++ b/compiler/src/dotty/tools/dotc/cc/Existential.scala @@ -3,12 +3,9 @@ package dotc package cc import core.* -import Types.*, Symbols.*, Contexts.*, Annotations.*, Flags.* -import CaptureSet.IdempotentCaptRefMap +import Types.*, Symbols.*, Contexts.*, Annotations.* import StdNames.nme -import ast.tpd.* import Decorators.* -import typer.ErrorReporting.errorType import Names.TermName import NameKinds.ExistentialBinderName import NameOps.isImpureFunction diff --git a/compiler/src/dotty/tools/dotc/cc/RetainingType.scala b/compiler/src/dotty/tools/dotc/cc/RetainingType.scala index efd0e96fd658..e35fc51157ca 100644 --- a/compiler/src/dotty/tools/dotc/cc/RetainingType.scala +++ b/compiler/src/dotty/tools/dotc/cc/RetainingType.scala @@ -6,7 +6,6 @@ import core.* import Types.*, Symbols.*, Contexts.* import ast.tpd.* import Annotations.Annotation -import Decorators.i /** A builder and extractor for annotated types with @retains or @retainsByName annotations. */ diff --git a/compiler/src/dotty/tools/dotc/cc/Setup.scala b/compiler/src/dotty/tools/dotc/cc/Setup.scala index e28aeb8e0313..07b8d7d22120 100644 --- a/compiler/src/dotty/tools/dotc/cc/Setup.scala +++ b/compiler/src/dotty/tools/dotc/cc/Setup.scala @@ -3,7 +3,7 @@ package dotc package cc import core.* -import Phases.*, DenotTransformers.*, SymDenotations.* +import DenotTransformers.*, SymDenotations.* import Contexts.*, Names.*, Flags.*, Symbols.*, Decorators.* import Types.*, StdNames.* import Annotations.Annotation @@ -11,14 +11,13 @@ import config.Feature import config.Printers.{capt, captDebug} import ast.tpd, tpd.* import transform.{PreRecheck, Recheck}, Recheck.* -import CaptureSet.{IdentityCaptRefMap, IdempotentCaptRefMap} +import CaptureSet.IdempotentCaptRefMap import Synthetics.isExcluded import util.SimpleIdentitySet import reporting.Message -import printing.{Printer, Texts}, Texts.{Text, Str} +import printing.Texts import collection.mutable import CCState.* -import dotty.tools.dotc.util.NoSourcePosition import CheckCaptures.CheckerAPI /** Operations accessed from CheckCaptures */ diff --git a/compiler/src/dotty/tools/dotc/classpath/DirectoryClassPath.scala b/compiler/src/dotty/tools/dotc/classpath/DirectoryClassPath.scala index 2d659b532d7b..2abe0fd74564 100644 --- a/compiler/src/dotty/tools/dotc/classpath/DirectoryClassPath.scala +++ b/compiler/src/dotty/tools/dotc/classpath/DirectoryClassPath.scala @@ -165,7 +165,7 @@ object JrtClassPath { * The implementation assumes that no classes exist in the empty package. */ final class JrtClassPath(fs: java.nio.file.FileSystem) extends ClassPath with NoSourcePaths { - import java.nio.file.Path, java.nio.file.* + import java.nio.file.Path type F = Path private val dir: Path = fs.getPath("/packages") diff --git a/compiler/src/dotty/tools/dotc/classpath/VirtualDirectoryClassPath.scala b/compiler/src/dotty/tools/dotc/classpath/VirtualDirectoryClassPath.scala index 0616d6c14ba6..7ae4e398bbf4 100644 --- a/compiler/src/dotty/tools/dotc/classpath/VirtualDirectoryClassPath.scala +++ b/compiler/src/dotty/tools/dotc/classpath/VirtualDirectoryClassPath.scala @@ -2,7 +2,7 @@ package dotty.tools.dotc.classpath import scala.language.unsafeNulls -import dotty.tools.io.{ClassPath, ClassRepresentation} +import dotty.tools.io.ClassPath import dotty.tools.io.{AbstractFile, VirtualDirectory} import FileUtils.* import java.net.{URI, URL} diff --git a/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala b/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala index d5473e6b26c3..3f29c00b8c1c 100644 --- a/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala +++ b/compiler/src/dotty/tools/dotc/classpath/ZipAndJarFileLookupFactory.scala @@ -12,7 +12,7 @@ import java.nio.file.Files import java.nio.file.attribute.{BasicFileAttributes, FileTime} import scala.annotation.tailrec -import dotty.tools.io.{AbstractFile, ClassPath, ClassRepresentation, FileZipArchive, ManifestResources} +import dotty.tools.io.{AbstractFile, ClassPath, FileZipArchive, ManifestResources} import dotty.tools.dotc.core.Contexts.* import FileUtils.* diff --git a/compiler/src/dotty/tools/dotc/config/Feature.scala b/compiler/src/dotty/tools/dotc/config/Feature.scala index 8b9a64924ace..6724b6e0ff98 100644 --- a/compiler/src/dotty/tools/dotc/config/Feature.scala +++ b/compiler/src/dotty/tools/dotc/config/Feature.scala @@ -6,12 +6,11 @@ import core.* import Contexts.*, Symbols.*, Names.* import StdNames.nme import Decorators.* -import util.{SrcPos, NoSourcePosition} +import util.SrcPos import SourceVersion.* import reporting.Message import NameKinds.QualifiedName import Annotations.ExperimentalAnnotation -import Settings.Setting.ChoiceWithHelp object Feature: diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 599812a9a390..2f9b7d9caef2 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -7,7 +7,7 @@ import dotty.tools.dotc.config.Settings.{Setting, SettingGroup, SettingCategory, import dotty.tools.dotc.config.SourceVersion import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.rewrites.Rewrites -import dotty.tools.io.{AbstractFile, Directory, JDK9Reflectors, PlainDirectory, NoAbstractFile} +import dotty.tools.io.{AbstractFile, Directory, PlainDirectory, NoAbstractFile} import Setting.ChoiceWithHelp import ScalaSettingCategories.* diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala index e42d2d53529e..94baa1e41a3f 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettingsProperties.scala @@ -3,7 +3,7 @@ package config import Settings.Setting.ChoiceWithHelp import dotty.tools.backend.jvm.BackendUtils.classfileVersionMap -import dotty.tools.io.{AbstractFile, Directory, JDK9Reflectors, PlainDirectory, NoAbstractFile} +import dotty.tools.io.JDK9Reflectors import scala.language.unsafeNulls object ScalaSettingsProperties: diff --git a/compiler/src/dotty/tools/dotc/core/CompilationUnitInfo.scala b/compiler/src/dotty/tools/dotc/core/CompilationUnitInfo.scala index d030182a5d7a..e92df218097e 100644 --- a/compiler/src/dotty/tools/dotc/core/CompilationUnitInfo.scala +++ b/compiler/src/dotty/tools/dotc/core/CompilationUnitInfo.scala @@ -1,7 +1,6 @@ package dotty.tools.dotc.core import dotty.tools.io.AbstractFile -import dotty.tools.tasty.TastyVersion /** Information about the compilation unit of a class symbol. * diff --git a/compiler/src/dotty/tools/dotc/core/Constraint.scala b/compiler/src/dotty/tools/dotc/core/Constraint.scala index b5979221e2c6..81cb274afdcb 100644 --- a/compiler/src/dotty/tools/dotc/core/Constraint.scala +++ b/compiler/src/dotty/tools/dotc/core/Constraint.scala @@ -4,7 +4,6 @@ package core import Types.*, Contexts.* import printing.Showable -import util.{SimpleIdentitySet, SimpleIdentityMap} /** Constraint over undetermined type parameters. Constraints are built * over values of the following types: diff --git a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala index 04d55475ec60..028ca3bb850f 100644 --- a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -12,7 +12,6 @@ import config.Printers.typr import typer.ProtoTypes.{newTypeVar, representedParamRef} import UnificationDirection.* import NameKinds.AvoidNameKind -import util.SimpleIdentitySet import NullOpsDecorator.stripNull /** Methods for adding constraints and solving them. diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala index 4f43d6c6663b..a2b0c717af79 100644 --- a/compiler/src/dotty/tools/dotc/core/Contexts.scala +++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala @@ -39,7 +39,6 @@ import dotty.tools.dotc.sbt.interfaces.{IncrementalCallback, ProgressCallback} import util.Property.Key import util.Store import plugins.* -import java.util.concurrent.atomic.AtomicInteger import java.nio.file.InvalidPathException import dotty.tools.dotc.coverage.Coverage @@ -936,7 +935,6 @@ object Contexts { def next()(using Context): FreshContext = val base = ctx.base - import base.* val nestedCtx = if inUse < pool.size then pool(inUse).reuseIn(ctx) diff --git a/compiler/src/dotty/tools/dotc/core/Decorators.scala b/compiler/src/dotty/tools/dotc/core/Decorators.scala index 96a2d45db80d..dd3976a943e9 100644 --- a/compiler/src/dotty/tools/dotc/core/Decorators.scala +++ b/compiler/src/dotty/tools/dotc/core/Decorators.scala @@ -7,7 +7,7 @@ import scala.collection.mutable.ListBuffer import scala.util.control.NonFatal import Contexts.*, Names.*, Phases.*, Symbols.* -import printing.{ Printer, Showable }, printing.Formatting.*, printing.Texts.* +import printing.Showable, printing.Formatting.*, printing.Texts.* import transform.MegaPhase import reporting.{Message, NoExplanation} diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 27ea5771c30b..e7febe3343ab 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -3,22 +3,18 @@ package dotc package core import scala.annotation.{threadUnsafe => tu} -import Types.*, Contexts.*, Symbols.*, SymDenotations.*, StdNames.*, Names.*, Phases.* +import Types.*, Contexts.*, Symbols.*, SymDenotations.*, StdNames.*, Names.* import Flags.*, Scopes.*, Decorators.*, NameOps.*, Periods.*, NullOpsDecorator.* import unpickleScala2.Scala2Unpickler.ensureConstructor -import scala.collection.mutable import collection.mutable -import Denotations.{SingleDenotation, staticRef} -import util.{SimpleIdentityMap, SourceFile, NoSource} +import Denotations.staticRef +import util.{SourceFile, NoSource} import typer.ImportInfo.RootRef import Comments.{Comment, docCtx} import util.Spans.NoSpan -import config.Feature -import Symbols.requiredModuleRef import cc.{CaptureSet, RetainingType, Existential} import ast.tpd.ref -import scala.annotation.tailrec import scala.compiletime.uninitialized object Definitions { diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala index 85ff51bc19de..290c6b0eed08 100644 --- a/compiler/src/dotty/tools/dotc/core/Denotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala @@ -17,7 +17,6 @@ import Decorators.* import Signature.MatchDegree.* import printing.Texts.* import printing.Printer -import io.AbstractFile import config.Config import config.Printers.overload import util.common.* diff --git a/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala b/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala index 5a8938602523..89b273a2b51d 100644 --- a/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala +++ b/compiler/src/dotty/tools/dotc/core/GadtConstraint.scala @@ -3,14 +3,12 @@ package dotc package core import Contexts.*, Decorators.*, Symbols.*, Types.* -import NameKinds.UniqueName import config.Printers.{gadts, gadtsConstr} -import util.{SimpleIdentitySet, SimpleIdentityMap} +import util.SimpleIdentityMap import printing.* import scala.annotation.tailrec import scala.annotation.internal.sharable -import scala.collection.mutable object GadtConstraint: @sharable val empty: GadtConstraint = diff --git a/compiler/src/dotty/tools/dotc/core/MatchTypes.scala b/compiler/src/dotty/tools/dotc/core/MatchTypes.scala index a3becea40886..23df8441a477 100644 --- a/compiler/src/dotty/tools/dotc/core/MatchTypes.scala +++ b/compiler/src/dotty/tools/dotc/core/MatchTypes.scala @@ -2,7 +2,7 @@ package dotty.tools package dotc package core -import Types.*, Contexts.*, Symbols.*, Flags.*, Decorators.* +import Types.*, Contexts.*, Symbols.*, Flags.* object MatchTypes: diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala index 415aa049c587..27baa2bf5eab 100644 --- a/compiler/src/dotty/tools/dotc/core/NameOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala @@ -8,7 +8,6 @@ import scala.io.Codec import Int.MaxValue import Names.*, StdNames.*, Contexts.*, Symbols.*, Flags.*, NameKinds.*, Types.* import util.Chars.{isOperatorPart, digit2int} -import Decorators.* import Definitions.* import nme.* diff --git a/compiler/src/dotty/tools/dotc/core/Phases.scala b/compiler/src/dotty/tools/dotc/core/Phases.scala index e3351628e43e..e74f6361f6b7 100644 --- a/compiler/src/dotty/tools/dotc/core/Phases.scala +++ b/compiler/src/dotty/tools/dotc/core/Phases.scala @@ -2,7 +2,6 @@ package dotty.tools package dotc package core -import Periods.* import Contexts.* import dotty.tools.backend.jvm.GenBCode import DenotTransformers.* diff --git a/compiler/src/dotty/tools/dotc/core/Scopes.scala b/compiler/src/dotty/tools/dotc/core/Scopes.scala index d6387ea1fe46..17e737777d1c 100644 --- a/compiler/src/dotty/tools/dotc/core/Scopes.scala +++ b/compiler/src/dotty/tools/dotc/core/Scopes.scala @@ -19,7 +19,6 @@ import printing.Printer import SymDenotations.NoDenotation import collection.mutable -import scala.compiletime.uninitialized object Scopes { diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 53df2d4aa39a..21c721db3709 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -2,8 +2,8 @@ package dotty.tools package dotc package core -import Periods.*, Contexts.*, Symbols.*, Denotations.*, Names.*, NameOps.*, Annotations.* -import Types.*, Flags.*, Decorators.*, DenotTransformers.*, StdNames.*, Scopes.* +import Periods.*, Contexts.*, Symbols.*, Denotations.*, Names.*, Annotations.* +import Types.*, Flags.*, DenotTransformers.*, StdNames.*, Scopes.* import NameOps.*, NameKinds.* import Phases.{Phase, typerPhase, unfusedPhases} import Constants.Constant diff --git a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala index 68f2e350c3e4..d3a617f5ab32 100644 --- a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala +++ b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala @@ -24,8 +24,7 @@ import ast.desugar import parsing.JavaParsers.OutlineJavaParser import parsing.Parsers.OutlineParser -import dotty.tools.tasty.{TastyHeaderUnpickler, UnpickleException, UnpicklerConfig, TastyVersion} -import dotty.tools.dotc.core.tasty.TastyUnpickler +import dotty.tools.tasty.UnpickleException import dotty.tools.tasty.besteffort.BestEffortTastyHeaderUnpickler object SymbolLoaders { diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index 7de75e371752..2f8fd25af1ff 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -31,7 +31,6 @@ import config.Printers.typr import dotty.tools.dotc.classpath.FileUtils.isScalaBinary import scala.compiletime.uninitialized -import dotty.tools.tasty.TastyVersion object Symbols extends SymUtils { diff --git a/compiler/src/dotty/tools/dotc/core/TastyInfo.scala b/compiler/src/dotty/tools/dotc/core/TastyInfo.scala index 0accd69f0adc..2a9b2c7709ab 100644 --- a/compiler/src/dotty/tools/dotc/core/TastyInfo.scala +++ b/compiler/src/dotty/tools/dotc/core/TastyInfo.scala @@ -1,6 +1,5 @@ package dotty.tools.dotc.core -import dotty.tools.io.AbstractFile import dotty.tools.tasty.TastyVersion /** Information about the TASTy of a class symbol. diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 136384413810..c0962b1eeeee 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -9,8 +9,7 @@ import SymDenotations.LazyType import Decorators.* import util.Stats.* import Names.* -import StdNames.nme -import Flags.{Module, Provisional} +import Flags.Module import dotty.tools.dotc.config.Config object TypeApplications { diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index bb52d97ac04e..6d49a6ae428c 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -2,11 +2,10 @@ package dotty.tools package dotc package core -import Types.*, Contexts.*, Symbols.*, Flags.*, Names.*, NameOps.*, Denotations.* +import Types.*, Contexts.*, Symbols.*, Flags.*, Names.*, Denotations.* import Decorators.* import Phases.{gettersPhase, elimByNamePhase} import StdNames.nme -import TypeOps.refineUsingParent import collection.mutable import util.{Stats, NoSourcePosition, EqHashMap} import config.Config diff --git a/compiler/src/dotty/tools/dotc/core/TypeErrors.scala b/compiler/src/dotty/tools/dotc/core/TypeErrors.scala index 4761beae8bd0..c4c96dc49384 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeErrors.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeErrors.scala @@ -16,7 +16,6 @@ import util.Property import config.Printers.{cyclicErrors, noPrinter} import collection.mutable -import scala.annotation.constructorOnly abstract class TypeError(using creationContext: Context) extends Exception(""): diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index a7f41a71d7ce..08228f9cb1c5 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -16,10 +16,8 @@ import config.Feature import typer.ProtoTypes.* import typer.ForceDegree import typer.Inferencing.* -import typer.IfBottom -import reporting.TestingReporter import cc.{CapturingType, derivedCapturingType, CaptureSet, captureSet, isBoxed, isBoxedCapturing} -import CaptureSet.{CompareResult, IdempotentCaptRefMap, IdentityCaptRefMap} +import CaptureSet.{IdempotentCaptRefMap, IdentityCaptRefMap} import scala.annotation.internal.sharable import scala.annotation.threadUnsafe diff --git a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala index 14ccf32c7787..482478a0d2ab 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeUtils.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeUtils.scala @@ -4,7 +4,7 @@ package core import TypeErasure.ErasedValueType import Types.*, Contexts.*, Symbols.*, Flags.*, Decorators.*, SymDenotations.* -import Names.{Name, TermName} +import Names.TermName import Constants.Constant import Names.Name diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 4296f971273f..6f5a78eebed2 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -5,7 +5,7 @@ package core import Symbols.* import Flags.* import Names.* -import StdNames.*, NameOps.* +import StdNames.* import NullOpsDecorator.* import NameKinds.{SkolemName, WildcardParamName} import Scopes.* @@ -39,11 +39,10 @@ import reporting.{trace, Message} import java.lang.ref.WeakReference import compiletime.uninitialized import cc.* -import CaptureSet.{CompareResult, IdempotentCaptRefMap, IdentityCaptRefMap} +import CaptureSet.{IdempotentCaptRefMap, IdentityCaptRefMap} import scala.annotation.internal.sharable import scala.annotation.threadUnsafe -import dotty.tools.dotc.cc.ccConfig object Types extends TypeUtils { diff --git a/compiler/src/dotty/tools/dotc/core/Variances.scala b/compiler/src/dotty/tools/dotc/core/Variances.scala index e18a31e46769..9390dc0dac66 100644 --- a/compiler/src/dotty/tools/dotc/core/Variances.scala +++ b/compiler/src/dotty/tools/dotc/core/Variances.scala @@ -1,7 +1,7 @@ package dotty.tools.dotc package core -import Types.*, Contexts.*, Flags.*, Symbols.*, Annotations.* +import Types.*, Contexts.*, Flags.*, Symbols.* import TypeApplications.TypeParamInfo import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index cfbdc854a88f..86381ed69b04 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -5,7 +5,6 @@ package classfile import scala.language.unsafeNulls -import dotty.tools.tasty.{ TastyReader, TastyHeaderUnpickler } import Contexts.*, Symbols.*, Types.*, Names.*, StdNames.*, NameOps.*, Scopes.*, Decorators.* import SymDenotations.*, unpickleScala2.Scala2Unpickler.*, Constants.*, Annotations.*, util.Spans.* @@ -15,13 +14,12 @@ import ast.tpd.*, util.* import java.io.IOException import java.lang.Integer.toHexString -import java.util.UUID import scala.collection.immutable import scala.collection.mutable.{ ListBuffer, ArrayBuffer } import scala.annotation.switch import typer.Checking.checkNonCyclic -import io.{AbstractFile, ZipArchive} +import io.AbstractFile import scala.util.control.NonFatal import dotty.tools.dotc.classpath.FileUtils.hasSiblingTasty diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileTastyUUIDParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileTastyUUIDParser.scala index e2220e40c6b4..d720a67fdbf7 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileTastyUUIDParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileTastyUUIDParser.scala @@ -17,7 +17,6 @@ import dotty.tools.tasty.TastyReader import ClassfileParser.Header import java.io.IOException -import java.lang.Integer.toHexString import java.util.UUID class ClassfileTastyUUIDParser(classfile: AbstractFile)(ictx: Context) { diff --git a/compiler/src/dotty/tools/dotc/core/tasty/AttributePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/AttributePickler.scala index cd2756f4c752..121e29fffeb7 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/AttributePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/AttributePickler.scala @@ -1,6 +1,5 @@ package dotty.tools.dotc.core.tasty -import dotty.tools.dotc.ast.{tpd, untpd} import dotty.tools.tasty.TastyBuffer import dotty.tools.tasty.TastyFormat.* diff --git a/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala index 43a2bea27216..f13b6dc0f13b 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/AttributeUnpickler.scala @@ -3,9 +3,8 @@ package core.tasty import scala.language.unsafeNulls import scala.collection.immutable.BitSet -import scala.collection.immutable.TreeMap -import dotty.tools.tasty.{TastyFormat, TastyReader, TastyBuffer}, TastyFormat.{isBooleanAttrTag, isStringAttrTag} +import dotty.tools.tasty.{TastyFormat, TastyReader}, TastyFormat.{isBooleanAttrTag, isStringAttrTag} import dotty.tools.dotc.core.tasty.TastyUnpickler.NameTable class AttributeUnpickler(reader: TastyReader, nameAtRef: NameTable): diff --git a/compiler/src/dotty/tools/dotc/core/tasty/Attributes.scala b/compiler/src/dotty/tools/dotc/core/tasty/Attributes.scala index 9e7c62ea9b5d..176f590c84fa 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/Attributes.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/Attributes.scala @@ -3,7 +3,6 @@ package dotty.tools.dotc.core.tasty import dotty.tools.tasty.TastyFormat.* import scala.collection.immutable.BitSet -import scala.collection.immutable.TreeMap class Attributes private[tasty]( private[tasty] val booleanTags: BitSet, diff --git a/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala index 39293b947326..e5e1dfddc68b 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala @@ -7,7 +7,6 @@ import dotty.tools.tasty.TastyBuffer import TastyBuffer.{Addr, NoAddr} import dotty.tools.tasty.TastyFormat.CommentsSection -import java.nio.charset.StandardCharsets object CommentPickler: diff --git a/compiler/src/dotty/tools/dotc/core/tasty/CommentUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/CommentUnpickler.scala index d3b5c647b9c5..c96d09bf216c 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/CommentUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/CommentUnpickler.scala @@ -10,7 +10,6 @@ import util.HashMap import dotty.tools.tasty.{TastyReader, TastyBuffer} import TastyBuffer.Addr -import java.nio.charset.StandardCharsets class CommentUnpickler(reader: TastyReader) { import reader.* diff --git a/compiler/src/dotty/tools/dotc/core/tasty/PositionPickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/PositionPickler.scala index 3d8080e72a29..b4d584e6709b 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/PositionPickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/PositionPickler.scala @@ -11,7 +11,7 @@ import ast.* import Trees.WithLazyFields import util.{SourceFile, NoSource} import core.* -import Annotations.*, Decorators.* +import Decorators.* import collection.mutable import util.Spans.* import reporting.Message diff --git a/compiler/src/dotty/tools/dotc/core/tasty/ScratchData.scala b/compiler/src/dotty/tools/dotc/core/tasty/ScratchData.scala index 889cf31a40b0..abd30c216a68 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/ScratchData.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/ScratchData.scala @@ -1,7 +1,6 @@ package dotty.tools.dotc.core.tasty import dotty.tools.tasty.TastyBuffer import collection.mutable -import java.util.Arrays class ScratchData: var delta, delta1 = new Array[Int](0) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala index f9d8e10cf16a..07548469e065 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyClassName.scala @@ -5,7 +5,6 @@ package tasty import dotty.tools.tasty.{TastyBuffer, TastyReader} import TastyBuffer.NameRef -import Contexts.*, Decorators.* import Names.TermName import StdNames.nme import TastyUnpickler.* diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala index 72f6895f122c..955cb42cbd7a 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala @@ -5,14 +5,11 @@ package tasty import dotty.tools.tasty.{TastyBuffer, TastyReader} import TastyBuffer.NameRef -import Contexts.*, Decorators.* -import Names.Name import TastyUnpickler.* import util.Spans.offsetToInt import dotty.tools.tasty.TastyFormat.{ASTsSection, PositionsSection, CommentsSection, AttributesSection} import java.nio.file.{Files, Paths} import dotty.tools.io.{JarArchive, Path} -import dotty.tools.tasty.TastyFormat.header import scala.collection.immutable.BitSet import scala.compiletime.uninitialized @@ -206,7 +203,6 @@ class TastyPrinter(bytes: Array[Byte], isBestEffortTasty: Boolean, val testPickl class PositionSectionUnpickler(sb: StringBuilder) extends PrinterSectionUnpickler[Unit](PositionsSection) { def unpickle0(reader: TastyReader)(using tastyName: NameRefs): Unit = { - import reader.* val posUnpickler = new PositionUnpickler(reader, tastyName) sb.append(sectionHeader("Positions", reader)) val lineSizes = posUnpickler.lineSizes @@ -238,7 +234,6 @@ class TastyPrinter(bytes: Array[Byte], isBestEffortTasty: Boolean, val testPickl class CommentSectionUnpickler(sb: StringBuilder) extends PrinterSectionUnpickler[Unit](CommentsSection) { def unpickle0(reader: TastyReader)(using NameRefs): Unit = { - import reader.* val comments = new CommentUnpickler(reader).comments if !comments.isEmpty then sb.append(sectionHeader("Comments", reader)) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala index f034f03298b1..75545c1db2ce 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyUnpickler.scala @@ -15,7 +15,6 @@ import scala.collection.mutable import Names.{TermName, termName, EmptyTermName} import NameKinds.* import dotty.tools.tasty.TastyHeader -import dotty.tools.tasty.TastyBuffer.Addr case class CommonTastyHeader( uuid: UUID, diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 7b80c7c80a21..5369d1228fcc 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -14,12 +14,11 @@ import ast.{untpd, tpd} import Contexts.*, Symbols.*, Types.*, Names.*, Constants.*, Decorators.*, Annotations.*, Flags.* import Comments.{Comment, docCtx} import NameKinds.* -import StdNames.{nme, tpnme} +import StdNames.nme import config.Config import collection.mutable import reporting.{Profile, NoProfile} import dotty.tools.tasty.TastyFormat.ASTsSection -import quoted.QuotePatterns object TreePickler: class StackSizeExceeded(val mdef: tpd.MemberDef) extends Exception diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index c07121a52191..461745116941 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -20,7 +20,6 @@ import Constants.* import Annotations.* import NameKinds.* import NamerOps.* -import ContextOps.* import Variances.Invariant import TastyUnpickler.NameTable import typer.ConstFold diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala index 78d1666ad580..d9f22e7a6987 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Erasure.scala @@ -3,7 +3,7 @@ package dotc package core package unpickleScala2 -import Symbols.*, Types.*, Contexts.*, Flags.*, Names.*, StdNames.*, Phases.* +import Symbols.*, Types.*, Contexts.*, Flags.*, Names.* import Decorators.* import scala.collection.mutable.ListBuffer diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index 3b91312740d1..d1b32b05b933 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -9,7 +9,7 @@ import java.io.IOException import java.lang.Float.intBitsToFloat import java.lang.Double.longBitsToDouble -import Contexts.*, Symbols.*, Types.*, Scopes.*, SymDenotations.*, Names.*, NameOps.* +import Contexts.*, Symbols.*, Types.*, Scopes.*, SymDenotations.*, Names.* import StdNames.*, Denotations.*, NameOps.*, Flags.*, Constants.*, Annotations.*, Phases.* import NameKinds.{Scala2MethodNameKinds, SuperAccessorName, ExpandedName} import util.Spans.* diff --git a/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala b/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala index f13bcdf00b34..e531bf09d4a6 100644 --- a/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala +++ b/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala @@ -11,7 +11,6 @@ import Denotations.staticRef import NameOps.* import ast.Trees.Tree import Phases.Phase -import core.tasty.Attributes /** Load trees from TASTY files */ class ReadTasty extends Phase { diff --git a/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala b/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala index 3edb323e6b3b..f3bc52d6d7bc 100644 --- a/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala +++ b/compiler/src/dotty/tools/dotc/inlines/InlineReducer.scala @@ -16,8 +16,8 @@ import collection.mutable /** A utility class offering methods for rewriting inlined code */ class InlineReducer(inliner: Inliner)(using Context): import tpd.* - import Inliner.{isElideableExpr, DefBuffer} - import inliner.{call, newSym, tryInlineArg, paramBindingDef} + import Inliner.isElideableExpr + import inliner.{call, newSym} extension (tp: Type) /** same as widenTermRefExpr, but preserves modules and singleton enum values */ diff --git a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala index 2242174f78f2..ee2016560119 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala @@ -9,7 +9,6 @@ import typer.* import Names.Name import NameKinds.InlineBinderName import ProtoTypes.shallowSelectionProto -import SymDenotations.SymDenotation import Inferencing.isFullyDefined import config.Printers.inlining import ErrorReporting.errorTree diff --git a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala index 85b1234461c8..d8b5eafd432a 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 StdNames.{tpnme, nme} import NameOps.* import typer.* import NameKinds.BodyRetainerName @@ -20,7 +19,7 @@ import transform.{PostTyper, Inlining, CrossVersionChecks} import staging.StagingLevel import collection.mutable -import reporting.{NotConstant, trace} +import reporting.NotConstant import util.Spans.Span import dotty.tools.dotc.core.Periods.PhaseId @@ -473,7 +472,6 @@ object Inlines: */ private class InlineCall(call: tpd.Tree)(using Context) extends Inliner(call): import tpd.* - import Inlines.* /** The Inlined node representing the inlined call */ def expand(rhsToInline: Tree): Tree = diff --git a/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala b/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala index bb950fbe43cd..757a3637db7c 100644 --- a/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala +++ b/compiler/src/dotty/tools/dotc/inlines/PrepareInlineable.scala @@ -5,7 +5,6 @@ package inlines import dotty.tools.dotc.ast.{Trees, tpd, untpd} import Trees.* import core.* -import Flags.* import Symbols.* import Flags.* import Types.* @@ -22,8 +21,6 @@ import staging.CrossStageSafety import config.Printers.inlining import util.Property import staging.StagingLevel -import dotty.tools.dotc.reporting.Message -import dotty.tools.dotc.util.SrcPos object PrepareInlineable { import tpd.* diff --git a/compiler/src/dotty/tools/dotc/interactive/Completion.scala b/compiler/src/dotty/tools/dotc/interactive/Completion.scala index 333af6a26b3b..f513e712fa72 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Completion.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Completion.scala @@ -2,7 +2,6 @@ package dotty.tools.dotc.interactive import dotty.tools.dotc.ast.untpd import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.ast.NavigateAST import dotty.tools.dotc.config.Printers.interactiv import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.* @@ -11,7 +10,6 @@ import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Names.{Name, TermName} import dotty.tools.dotc.core.NameKinds.SimpleNameKind import dotty.tools.dotc.core.NameOps.* -import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Scopes.* import dotty.tools.dotc.core.Symbols.{NoSymbol, Symbol, defn, newSymbol} import dotty.tools.dotc.core.StdNames.nme @@ -26,9 +24,6 @@ import dotty.tools.dotc.util.Chars import dotty.tools.dotc.util.SourcePosition import scala.collection.mutable -import scala.util.control.NonFatal -import dotty.tools.dotc.core.ContextOps.localContext -import dotty.tools.dotc.core.Names import dotty.tools.dotc.core.Types import dotty.tools.dotc.core.Symbols import dotty.tools.dotc.core.Constants diff --git a/compiler/src/dotty/tools/dotc/interactive/Interactive.scala b/compiler/src/dotty/tools/dotc/interactive/Interactive.scala index 16079125a434..f0343260e076 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Interactive.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Interactive.scala @@ -8,7 +8,7 @@ import scala.collection.* import ast.{NavigateAST, Trees, tpd, untpd} import core.* -import Decorators.*, ContextOps.* +import ContextOps.* import Contexts.*, Flags.*, Names.*, NameOps.*, Symbols.*, Trees.*, Types.* import util.Spans.*, util.SourceFile, util.SourcePosition diff --git a/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala b/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala index 673874ae2769..72cd4d06da87 100644 --- a/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala +++ b/compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala @@ -8,11 +8,9 @@ import java.net.URI import java.io.* import java.nio.file.* import java.nio.file.attribute.BasicFileAttributes -import java.nio.charset.StandardCharsets import java.util.zip.* import scala.collection.* -import scala.io.Codec import dotty.tools.io.AbstractFile diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 38f554c10b0a..6836c2c657f0 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -4,7 +4,6 @@ package parsing import scala.language.unsafeNulls -import scala.annotation.internal.sharable import scala.collection.mutable.ListBuffer import scala.collection.immutable.BitSet import util.{ SourceFile, SourcePosition, NoSourcePosition } @@ -15,7 +14,7 @@ import core.* import Flags.* import Contexts.* import Names.* -import NameKinds.{WildcardParamName, QualifiedName} +import NameKinds.WildcardParamName import NameOps.* import ast.{Positioned, Trees} import ast.Trees.* diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index 2007b633a7c5..adb6e3f509c1 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -4,7 +4,7 @@ package parsing import scala.language.unsafeNulls -import core.Names.*, core.Contexts.*, core.Decorators.*, util.Spans.* +import core.Names.*, core.Contexts.*, core.Decorators.* import core.StdNames.*, core.Comments.* import util.SourceFile import util.Chars.* @@ -18,13 +18,12 @@ import scala.collection.immutable.SortedMap import rewrites.Rewrites.patch import config.Feature import config.Feature.{migrateTo3, fewerBracesEnabled} -import config.SourceVersion.{`3.0`, `3.0-migration`} +import config.SourceVersion.`3.0-migration` import config.MigrationVersion import reporting.{NoProfile, Profile, Message} import java.util.Objects import dotty.tools.dotc.reporting.Message.rewriteNotice -import dotty.tools.dotc.config.Feature.sourceVersion object Scanners { diff --git a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala index 06e8645b82c0..517a77605f62 100644 --- a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala @@ -17,7 +17,6 @@ import util.Spans.* import core.* import Constants.* import Decorators.{em, toMessage} -import util.SourceFile import Utility.* diff --git a/compiler/src/dotty/tools/dotc/plugins/Plugins.scala b/compiler/src/dotty/tools/dotc/plugins/Plugins.scala index a6672d475129..d125ad474fb7 100644 --- a/compiler/src/dotty/tools/dotc/plugins/Plugins.scala +++ b/compiler/src/dotty/tools/dotc/plugins/Plugins.scala @@ -6,7 +6,7 @@ import scala.language.unsafeNulls import core.* import Contexts.* import Decorators.em -import config.{ PathResolver, Feature } +import config.PathResolver import dotty.tools.io.* import Phases.* import config.Printers.plugins.{ println => debug } diff --git a/compiler/src/dotty/tools/dotc/printing/Formatting.scala b/compiler/src/dotty/tools/dotc/printing/Formatting.scala index ccd7b4e4e282..9def2d1bf541 100644 --- a/compiler/src/dotty/tools/dotc/printing/Formatting.scala +++ b/compiler/src/dotty/tools/dotc/printing/Formatting.scala @@ -2,12 +2,10 @@ package dotty.tools package dotc package printing -import scala.collection.mutable import core.* -import Texts.*, Types.*, Flags.*, Symbols.*, Contexts.* +import Types.*, Flags.*, Contexts.* import Decorators.* -import reporting.Message import util.DiffUtil import Highlighting.* diff --git a/compiler/src/dotty/tools/dotc/printing/OutlinePrinter.scala b/compiler/src/dotty/tools/dotc/printing/OutlinePrinter.scala index cd8267355201..55fddfb35631 100644 --- a/compiler/src/dotty/tools/dotc/printing/OutlinePrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/OutlinePrinter.scala @@ -5,7 +5,6 @@ package printing import core.* import Texts.* import Flags.* -import NameOps.* import StdNames.* import Contexts.* import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala index 27ab73f0fe4d..2ee3cb3419f9 100644 --- a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -18,13 +18,13 @@ import SymDenotations.* import StdNames.{nme, tpnme} import ast.{Trees, tpd, untpd} import tpd.closureDef -import typer.{Implicits, Namer, Applications} +import typer.{Implicits, Namer} import typer.ProtoTypes.* import Trees.* import TypeApplications.* import NameKinds.{WildcardParamName, DefaultGetterName} import util.Chars.isOperatorPart -import config.{Config, Feature} +import config.Feature import config.Feature.sourceVersion import config.SourceVersion.* diff --git a/compiler/src/dotty/tools/dotc/profile/ChromeTrace.scala b/compiler/src/dotty/tools/dotc/profile/ChromeTrace.scala index 4950f439640f..dccf4a99c879 100644 --- a/compiler/src/dotty/tools/dotc/profile/ChromeTrace.scala +++ b/compiler/src/dotty/tools/dotc/profile/ChromeTrace.scala @@ -17,8 +17,7 @@ import scala.language.unsafeNulls import java.io.Closeable import java.lang.management.ManagementFactory -import java.nio.file.{Files, Path} -import java.util +import java.nio.file.Path import java.util.concurrent.TimeUnit import scala.collection.mutable diff --git a/compiler/src/dotty/tools/dotc/profile/Profiler.scala b/compiler/src/dotty/tools/dotc/profile/Profiler.scala index ab3e73468385..75c9cf3021d0 100644 --- a/compiler/src/dotty/tools/dotc/profile/Profiler.scala +++ b/compiler/src/dotty/tools/dotc/profile/Profiler.scala @@ -149,7 +149,6 @@ private [profile] object RealProfiler { @nowarn("cat=deprecation") private[profile] def snapThread(idleTimeNanos: Long): ProfileSnap = { - import RealProfiler.* val current = Thread.currentThread() ProfileSnap( diff --git a/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala b/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala index e34d35065476..9d35247215cf 100644 --- a/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala +++ b/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala @@ -3,15 +3,12 @@ package quoted import scala.language.unsafeNulls -import scala.collection.mutable import scala.reflect.ClassTag import java.io.{PrintWriter, StringWriter} import java.lang.reflect.{InvocationTargetException, Method => JLRMethod} import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.ast.TreeMapWithImplicits -import dotty.tools.dotc.core.Annotations.* import dotty.tools.dotc.core.Constants.* import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.* @@ -23,8 +20,6 @@ import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.TypeErasure import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.quoted.* -import dotty.tools.dotc.typer.ImportInfo.withRootImports import dotty.tools.dotc.util.SrcPos import dotty.tools.dotc.reporting.Message import dotty.tools.repl.AbstractFileClassLoader diff --git a/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala b/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala index 82701dafd2c9..18ef60cfd740 100644 --- a/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala +++ b/compiler/src/dotty/tools/dotc/quoted/QuotePatterns.scala @@ -1,13 +1,10 @@ package dotty.tools.dotc package quoted -import dotty.tools.dotc.ast.TreeTypeMap import dotty.tools.dotc.ast.Trees.* import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.ast.untpd import dotty.tools.dotc.core.* -import dotty.tools.dotc.core.Annotations.* -import dotty.tools.dotc.core.Constants.* import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.Flags.* @@ -15,9 +12,7 @@ import dotty.tools.dotc.core.NameKinds.PatMatGivenVarName import dotty.tools.dotc.core.Names.* 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.reporting.IllegalVariableInPatternAlternative import scala.collection.mutable diff --git a/compiler/src/dotty/tools/dotc/report.scala b/compiler/src/dotty/tools/dotc/report.scala index 2ccf918e12fa..0196b109168a 100644 --- a/compiler/src/dotty/tools/dotc/report.scala +++ b/compiler/src/dotty/tools/dotc/report.scala @@ -4,8 +4,7 @@ import reporting.* import Diagnostic.* import util.{SourcePosition, NoSourcePosition, SrcPos} import core.* -import Contexts.*, Flags.*, Symbols.*, Decorators.* -import config.SourceVersion +import Contexts.*, Symbols.*, Decorators.* import ast.* import config.Feature.sourceVersion import java.lang.System.currentTimeMillis @@ -151,7 +150,7 @@ object report: catch case _: Throwable => errorMessage // don't introduce new errors trying to report errors, so swallow exceptions private def enrichErrorMessage1(errorMessage: String)(using Context): String = { - import untpd.*, config.Settings.* + import config.Settings.* def formatExplain(pairs: List[(String, Any)]) = pairs.map((k, v) => f"$k%20s: $v").mkString("\n") val settings = ctx.settings.userSetSettings(ctx.settingsState).sortBy(_.name) diff --git a/compiler/src/dotty/tools/dotc/reporting/DidYouMean.scala b/compiler/src/dotty/tools/dotc/reporting/DidYouMean.scala index 14e5e7798e05..89177e9ea512 100644 --- a/compiler/src/dotty/tools/dotc/reporting/DidYouMean.scala +++ b/compiler/src/dotty/tools/dotc/reporting/DidYouMean.scala @@ -4,8 +4,8 @@ package reporting import core.* import Contexts.* -import Decorators.*, Symbols.*, Names.*, Types.*, Flags.* -import typer.ProtoTypes.{FunProto, SelectionProto} +import Symbols.*, Names.*, Types.*, Flags.* +import typer.ProtoTypes.SelectionProto /** A utility object to support "did you mean" hinting */ object DidYouMean: diff --git a/compiler/src/dotty/tools/dotc/reporting/Profile.scala b/compiler/src/dotty/tools/dotc/reporting/Profile.scala index 6e2f83364dbe..a7d0fb8e31c7 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Profile.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Profile.scala @@ -5,12 +5,9 @@ package reporting import core.* import Contexts.{Context, ctx} import Symbols.{Symbol, NoSymbol} -import collection.mutable -import util.{EqHashMap, NoSourcePosition} +import util.EqHashMap import util.Spans.{Span, NoSpan} -import Decorators.i import parsing.Scanners.Scanner -import io.AbstractFile import annotation.internal.sharable abstract class Profile: diff --git a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala index 61f842800b78..8ea274085d99 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.Symbols.{NoSymbol, Symbol} import dotty.tools.dotc.reporting.Diagnostic.* -import dotty.tools.dotc.reporting.Message.* import dotty.tools.dotc.util.NoSourcePosition import java.io.{BufferedReader, PrintWriter} diff --git a/compiler/src/dotty/tools/dotc/reporting/WConf.scala b/compiler/src/dotty/tools/dotc/reporting/WConf.scala index 1896e5269d6c..86caecb34b1b 100644 --- a/compiler/src/dotty/tools/dotc/reporting/WConf.scala +++ b/compiler/src/dotty/tools/dotc/reporting/WConf.scala @@ -6,7 +6,6 @@ import scala.language.unsafeNulls import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.util.{NoSourcePosition, SourcePosition} -import dotty.tools.dotc.interfaces.SourceFile import dotty.tools.dotc.reporting.MessageFilter.SourcePattern import java.util.regex.PatternSyntaxException diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala index ab4f40677371..927bf5aa8211 100644 --- a/compiler/src/dotty/tools/dotc/reporting/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala @@ -18,7 +18,7 @@ import config.{Feature, ScalaVersion} import transform.patmat.Space import transform.patmat.SpaceEngine import typer.ErrorReporting.{err, matchReductionAddendum, substitutableTypeSymbolsInScope} -import typer.ProtoTypes.{ViewProto, SelectionProto, FunProto} +import typer.ProtoTypes.{ViewProto, FunProto} import typer.Implicits.* import typer.Inferencing import scala.util.control.NonFatal @@ -33,7 +33,6 @@ import cc.CaptureSet.IdentityCaptRefMap import dotty.tools.dotc.rewrites.Rewrites.ActionPatch import dotty.tools.dotc.util.Spans.Span import dotty.tools.dotc.util.SourcePosition -import scala.jdk.CollectionConverters.* import dotty.tools.dotc.util.SourceFile import dotty.tools.dotc.config.SourceVersion import DidYouMean.* diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index 75e859111932..fe1e38303ae6 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -16,10 +16,8 @@ import Types.* import Symbols.* import Names.* import StdNames.str -import NameOps.* import inlines.Inlines import transform.ValueClasses -import transform.Pickler import dotty.tools.io.{File, FileExtension, JarArchive} import util.{Property, SourceFile} import java.io.PrintWriter diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala index 154d50f8ebc2..4ed324176549 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala @@ -3,7 +3,6 @@ package sbt import scala.language.unsafeNulls -import java.io.File import java.nio.file.Path import java.util.{Arrays, EnumSet} @@ -21,14 +20,14 @@ import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.util.{SrcPos, NoSourcePosition} import dotty.tools.io -import dotty.tools.io.{AbstractFile, PlainFile, ZipArchive, NoAbstractFile, FileExtension} +import dotty.tools.io.{PlainFile, ZipArchive, FileExtension} import xsbti.UseScope import xsbti.api.DependencyContext import xsbti.api.DependencyContext.* import scala.jdk.CollectionConverters.* -import scala.collection.{Set, mutable} +import scala.collection.mutable import scala.compiletime.uninitialized /** This phase sends information on classes' dependencies to sbt via callbacks. @@ -51,7 +50,6 @@ import scala.compiletime.uninitialized * @see ExtractAPI */ class ExtractDependencies extends Phase { - import ExtractDependencies.* override def phaseName: String = ExtractDependencies.name @@ -548,7 +546,6 @@ class DependencyRecorder { * This is backed by a cache which is invalidated when `ctx.owner` changes. */ private def resolveDependencyFromClass(using Context): Symbol = { - import dotty.tools.uncheckedNN if (lastOwner != ctx.owner) { lastOwner = ctx.owner val source = nonLocalEnclosingClass diff --git a/compiler/src/dotty/tools/dotc/sbt/package.scala b/compiler/src/dotty/tools/dotc/sbt/package.scala index 1c6b38b07a84..8efa25569325 100644 --- a/compiler/src/dotty/tools/dotc/sbt/package.scala +++ b/compiler/src/dotty/tools/dotc/sbt/package.scala @@ -10,7 +10,6 @@ import interfaces.IncrementalCallback import dotty.tools.io.FileWriters.BufferingReporter import dotty.tools.dotc.core.Decorators.em -import scala.util.chaining.given import scala.util.control.NonFatal inline val TermNameHash = 1987 // 300th prime diff --git a/compiler/src/dotty/tools/dotc/semanticdb/DiagnosticOps.scala b/compiler/src/dotty/tools/dotc/semanticdb/DiagnosticOps.scala index 4bc6e1ecb026..e55141eab8d5 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/DiagnosticOps.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/DiagnosticOps.scala @@ -3,7 +3,6 @@ package dotty.tools.dotc.semanticdb import dotty.tools.dotc.reporting.Diagnostic import dotty.tools.dotc.{semanticdb => s} import dotty.tools.dotc.interfaces.Diagnostic.{ERROR, INFO, WARNING} -import dotty.tools.dotc.core.Contexts.Context import scala.annotation.internal.sharable object DiagnosticOps: diff --git a/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala b/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala index 05dff8ffadbc..0ef5b801d410 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala @@ -125,7 +125,6 @@ class ExtractSemanticDB private (phaseMode: ExtractSemanticDB.PhaseMode) extends end ExtractSemanticDB object ExtractSemanticDB: - import java.nio.file.Path import java.nio.file.Files import java.nio.file.Paths diff --git a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala index 4293ecd6ca43..3e4998819ae6 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala @@ -15,7 +15,6 @@ import collection.mutable import dotty.tools.dotc.{semanticdb => s} import Scala3.{FakeSymbol, SemanticSymbol, WildcardTypeSymbol, TypeParamRefSymbol, TermParamRefSymbol, RefinementSymbol} -import dotty.tools.dotc.core.Names.Designator class TypeOps: import SymbolScopeOps.* @@ -527,7 +526,7 @@ class TypeOps: object SymbolScopeOps: - import Scala3.{_, given} + import Scala3.given extension (syms: List[SemanticSymbol]) def sscope(using linkMode: LinkMode)(using SemanticSymbolBuilder, TypeOps, Context): s.Scope = linkMode match diff --git a/compiler/src/dotty/tools/dotc/semanticdb/generated/Language.scala b/compiler/src/dotty/tools/dotc/semanticdb/generated/Language.scala index ef47e9020361..e0bdec160afc 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/generated/Language.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/generated/Language.scala @@ -6,7 +6,6 @@ package dotty.tools.dotc.semanticdb import dotty.tools.dotc.semanticdb.internal.* -import scala.annotation.internal.sharable sealed abstract class Language(val value: _root_.scala.Int) extends SemanticdbGeneratedEnum derives CanEqual { type EnumType = Language diff --git a/compiler/src/dotty/tools/dotc/semanticdb/generated/Schema.scala b/compiler/src/dotty/tools/dotc/semanticdb/generated/Schema.scala index c9239c85f409..2694283db191 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/generated/Schema.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/generated/Schema.scala @@ -6,7 +6,6 @@ package dotty.tools.dotc.semanticdb import dotty.tools.dotc.semanticdb.internal.* -import scala.annotation.internal.sharable sealed abstract class Schema(val value: _root_.scala.Int) extends SemanticdbGeneratedEnum derives CanEqual { type EnumType = Schema diff --git a/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala b/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala index 85f2e84429c3..a5b8113f2f27 100644 --- a/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala +++ b/compiler/src/dotty/tools/dotc/staging/CrossStageSafety.scala @@ -6,7 +6,6 @@ import dotty.tools.dotc.core.Annotations.* import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.Flags.* -import dotty.tools.dotc.core.NameKinds.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Types.* @@ -14,7 +13,6 @@ import dotty.tools.dotc.quoted.QuotePatterns import dotty.tools.dotc.staging.QuoteTypeTags.* import dotty.tools.dotc.staging.StagingLevel.* import dotty.tools.dotc.util.Property -import dotty.tools.dotc.util.Spans.* import dotty.tools.dotc.util.SrcPos /** Checks that staging level consistency holds and heals staged types. diff --git a/compiler/src/dotty/tools/dotc/staging/HealType.scala b/compiler/src/dotty/tools/dotc/staging/HealType.scala index a73f884fbac9..eb54ba0a6399 100644 --- a/compiler/src/dotty/tools/dotc/staging/HealType.scala +++ b/compiler/src/dotty/tools/dotc/staging/HealType.scala @@ -5,7 +5,6 @@ import reporting.* import core.Contexts.* import core.Decorators.* -import core.Flags.* import core.StdNames.* import core.Symbols.* import core.Types.* diff --git a/compiler/src/dotty/tools/dotc/staging/QuoteTypeTags.scala b/compiler/src/dotty/tools/dotc/staging/QuoteTypeTags.scala index 467f1f440fd6..b3baa80f7983 100644 --- a/compiler/src/dotty/tools/dotc/staging/QuoteTypeTags.scala +++ b/compiler/src/dotty/tools/dotc/staging/QuoteTypeTags.scala @@ -2,10 +2,8 @@ package dotty.tools.dotc.staging import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.* -import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types.* -import dotty.tools.dotc.staging.StagingLevel.* import dotty.tools.dotc.util.Property import scala.collection.mutable.LinkedHashSet diff --git a/compiler/src/dotty/tools/dotc/staging/StagingLevel.scala b/compiler/src/dotty/tools/dotc/staging/StagingLevel.scala index 0a229881804e..2112286e7e96 100644 --- a/compiler/src/dotty/tools/dotc/staging/StagingLevel.scala +++ b/compiler/src/dotty/tools/dotc/staging/StagingLevel.scala @@ -2,14 +2,9 @@ package dotty.tools.dotc package staging import dotty.tools.dotc.core.Contexts.* -import dotty.tools.dotc.core.Decorators.* -import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Symbols.* -import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.util.Property -import dotty.tools.dotc.util.SrcPos -import scala.collection.mutable object StagingLevel { diff --git a/compiler/src/dotty/tools/dotc/staging/TreeMapWithStages.scala b/compiler/src/dotty/tools/dotc/staging/TreeMapWithStages.scala index c2607f3daa68..c6fd322701be 100644 --- a/compiler/src/dotty/tools/dotc/staging/TreeMapWithStages.scala +++ b/compiler/src/dotty/tools/dotc/staging/TreeMapWithStages.scala @@ -8,7 +8,6 @@ import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.staging.StagingLevel.* -import scala.collection.mutable /** TreeMap that keeps track of staging levels using StagingLevel. */ abstract class TreeMapWithStages extends TreeMapWithImplicits { diff --git a/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala b/compiler/src/dotty/tools/dotc/transform/AccessProxies.scala index 1f9334164496..6b7dd77abd1a 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 util.Spans.Span import config.Printers.transforms import Annotations.ExperimentalAnnotation diff --git a/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala b/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala index 1a6ec307e289..7b7a3fdc46ba 100644 --- a/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala +++ b/compiler/src/dotty/tools/dotc/transform/ArrayApply.scala @@ -3,8 +3,7 @@ package dotc package transform import ast.tpd -import core.*, Contexts.*, Decorators.*, Symbols.*, Flags.*, StdNames.* -import reporting.trace +import core.*, Contexts.*, Symbols.*, Flags.*, StdNames.* import util.Property import MegaPhase.* diff --git a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala index c1725cbd0255..80587c24ef65 100644 --- a/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala +++ b/compiler/src/dotty/tools/dotc/transform/CapturedVars.scala @@ -9,12 +9,8 @@ import core.Flags.* import core.Decorators.* import core.StdNames.nme import core.Names.* -import core.NameKinds.TempResultName -import core.Constants.* -import util.Store import dotty.tools.uncheckedNN import ast.tpd.* -import compiletime.uninitialized /** This phase translates variables that are captured in closures to * heap-allocated refs. diff --git a/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala b/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala index 8625d2dbb289..293f4c77d976 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckLoopingImplicits.scala @@ -3,7 +3,7 @@ package transform import core.* import MegaPhase.MiniPhase -import Contexts.*, Types.*, Symbols.*, SymDenotations.*, Flags.* +import Contexts.*, Types.*, Symbols.*, Flags.* import ast.* import Decorators.* import StdNames.* diff --git a/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala b/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala index 127bd57b1bf2..2a5025ac748e 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckNoSuperThis.scala @@ -3,7 +3,7 @@ package transform import core.* import MegaPhase.MiniPhase -import Contexts.*, Types.*, Symbols.*, SymDenotations.*, Flags.* +import Contexts.*, Types.*, Symbols.*, Flags.* import ast.* import Decorators.* diff --git a/compiler/src/dotty/tools/dotc/transform/CheckShadowing.scala b/compiler/src/dotty/tools/dotc/transform/CheckShadowing.scala index 87d652bd9133..f27c0127e17b 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckShadowing.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckShadowing.scala @@ -1,38 +1,16 @@ package dotty.tools.dotc.transform import dotty.tools.dotc.ast.tpd -import dotty.tools.dotc.ast.Trees.EmptyTree -import dotty.tools.dotc.transform.MegaPhase import dotty.tools.dotc.transform.MegaPhase.MiniPhase import dotty.tools.dotc.report import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.util.{Property, SrcPos} -import dotty.tools.dotc.core.Symbols.ClassSymbol import dotty.tools.dotc.core.Names.Name import dotty.tools.dotc.core.Symbols.Symbol -import dotty.tools.dotc.core.Flags.EmptyFlags import dotty.tools.dotc.ast.tpd.TreeTraverser -import dotty.tools.dotc.core.Types.watchList -import dotty.tools.dotc.core.Types.NoType -import dotty.tools.dotc.core.Types.Type -import dotty.tools.dotc.core.Types -import dotty.tools.dotc.semanticdb.TypeOps -import dotty.tools.dotc.cc.boxedCaptureSet -import dotty.tools.dotc.core.Symbols.{NoSymbol, isParamOrAccessor} -import scala.collection.mutable -import dotty.tools.dotc.core.Scopes.Scope -import scala.collection.immutable.HashMap -import dotty.tools.dotc.core.Symbols -import dotty.tools.dotc.typer.ImportInfo -import dotty.tools.dotc.ast.untpd.ImportSelector -import dotty.tools.dotc.core.StdNames.nme -import dotty.tools.dotc.ast.untpd import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.ast.Trees.Ident -import dotty.tools.dotc.core.Names.TypeName -import dotty.tools.dotc.core.Names.TermName -import dotty.tools.dotc.core.Mode.Type import dotty.tools.dotc.core.Names.SimpleName class CheckShadowing extends MiniPhase: diff --git a/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala b/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala index 6e626fc5dd9e..e91990070590 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala @@ -6,33 +6,22 @@ import scala.collection.mutable import dotty.tools.uncheckedNN import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Symbols.* -import dotty.tools.dotc.ast.tpd.{Inlined, TreeTraverser} +import dotty.tools.dotc.ast.tpd.TreeTraverser import dotty.tools.dotc.ast.untpd import dotty.tools.dotc.ast.untpd.ImportSelector -import dotty.tools.dotc.config.ScalaSettings import dotty.tools.dotc.core.Contexts.* -import dotty.tools.dotc.core.Decorators.{em, i} -import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.Flags.* -import dotty.tools.dotc.core.Phases.Phase import dotty.tools.dotc.core.StdNames import dotty.tools.dotc.report -import dotty.tools.dotc.reporting.Message import dotty.tools.dotc.reporting.UnusedSymbol as UnusedSymbolMessage -import dotty.tools.dotc.typer.ImportInfo import dotty.tools.dotc.util.{Property, SrcPos} -import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.Types.{AnnotatedType, ConstantType, NoType, TermRef, Type, TypeTraverser} -import dotty.tools.dotc.core.Flags.flagsString import dotty.tools.dotc.core.Flags import dotty.tools.dotc.core.Names.{Name, TermName} import dotty.tools.dotc.core.NameOps.isReplWrapperName import dotty.tools.dotc.transform.MegaPhase.MiniPhase -import dotty.tools.dotc.core.Annotations -import dotty.tools.dotc.core.Definitions import dotty.tools.dotc.core.NameKinds.WildcardParamName import dotty.tools.dotc.core.Symbols.Symbol -import dotty.tools.dotc.core.StdNames.nme import dotty.tools.dotc.util.Spans.Span import scala.math.Ordering @@ -217,7 +206,6 @@ class CheckUnused private (phaseMode: CheckUnused.PhaseMode, suffix: String, _ke */ private def traverser = new TreeTraverser: import tpd.* - import UnusedData.ScopeType /* Register every imports, definition and usage */ override def traverse(tree: tpd.Tree)(using Context): Unit = diff --git a/compiler/src/dotty/tools/dotc/transform/Constructors.scala b/compiler/src/dotty/tools/dotc/transform/Constructors.scala index 9a0df830c6d7..ef36e4267af8 100644 --- a/compiler/src/dotty/tools/dotc/transform/Constructors.scala +++ b/compiler/src/dotty/tools/dotc/transform/Constructors.scala @@ -15,7 +15,6 @@ import Symbols.* import Decorators.* import DenotTransformers.* import collection.mutable -import Types.* object Constructors { val name: String = "constructors" diff --git a/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala b/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala index c31b2673e04a..8a56095cbd1c 100644 --- a/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala +++ b/compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala @@ -4,7 +4,6 @@ package transform import core.* import Contexts.*, Symbols.*, Types.*, Annotations.*, Constants.*, Phases.* -import Decorators.* import StdNames.nme import ast.untpd import ast.tpd.* diff --git a/compiler/src/dotty/tools/dotc/transform/DropBreaks.scala b/compiler/src/dotty/tools/dotc/transform/DropBreaks.scala index 5f26a6af6c3c..45c2003f4de1 100644 --- a/compiler/src/dotty/tools/dotc/transform/DropBreaks.scala +++ b/compiler/src/dotty/tools/dotc/transform/DropBreaks.scala @@ -7,11 +7,9 @@ import core.* import Decorators.* import NameKinds.BoundaryName import MegaPhase.* -import Types.*, Contexts.*, Flags.*, DenotTransformers.* +import Types.*, Contexts.*, Flags.* import Symbols.*, StdNames.*, Trees.* import util.Property -import Constants.Constant -import Flags.MethodOrLazy object DropBreaks: val name: String = "dropBreaks" diff --git a/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala b/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala index b3bd1ab8dd26..4211db2036e5 100644 --- a/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala +++ b/compiler/src/dotty/tools/dotc/transform/DropOuterAccessors.scala @@ -3,7 +3,6 @@ package transform import core.* import MegaPhase.MiniPhase -import dotty.tools.dotc.core.Contexts.* import ast.* import Flags.* import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/transform/DropParentRefinements.scala b/compiler/src/dotty/tools/dotc/transform/DropParentRefinements.scala index 1960568dc505..f3b852e88b49 100644 --- a/compiler/src/dotty/tools/dotc/transform/DropParentRefinements.scala +++ b/compiler/src/dotty/tools/dotc/transform/DropParentRefinements.scala @@ -16,7 +16,6 @@ object DropParentRefinements: */ class DropParentRefinements extends MiniPhase with IdentityDenotTransformer: thisPhase => - import tpd.* override def phaseName: String = DropParentRefinements.name diff --git a/compiler/src/dotty/tools/dotc/transform/ElimErasedValueType.scala b/compiler/src/dotty/tools/dotc/transform/ElimErasedValueType.scala index 2deb50956537..8b16bbee6ec1 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimErasedValueType.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimErasedValueType.scala @@ -3,11 +3,11 @@ package dotc package transform import ast.{Trees, tpd} -import core.*, core.Decorators.* +import core.* import MegaPhase.* import Types.*, Contexts.*, Flags.*, DenotTransformers.*, Phases.* import Symbols.*, StdNames.*, Trees.* -import TypeErasure.ErasedValueType, ValueClasses.* +import TypeErasure.ErasedValueType import reporting.* import NameKinds.SuperAccessorName diff --git a/compiler/src/dotty/tools/dotc/transform/ElimPackagePrefixes.scala b/compiler/src/dotty/tools/dotc/transform/ElimPackagePrefixes.scala index 6c577a872c56..94dc3291e809 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimPackagePrefixes.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimPackagePrefixes.scala @@ -2,7 +2,7 @@ package dotty.tools.dotc package transform import core.* -import Decorators.*, Flags.*, Types.*, Contexts.*, Symbols.* +import Decorators.*, Types.*, Contexts.*, Symbols.* import ast.tpd.* import Flags.* import MegaPhase.MiniPhase diff --git a/compiler/src/dotty/tools/dotc/transform/ElimPolyFunction.scala b/compiler/src/dotty/tools/dotc/transform/ElimPolyFunction.scala index 3ed337ee3a4a..c7fbb1f33274 100644 --- a/compiler/src/dotty/tools/dotc/transform/ElimPolyFunction.scala +++ b/compiler/src/dotty/tools/dotc/transform/ElimPolyFunction.scala @@ -3,10 +3,9 @@ package transform import ast.{Trees, tpd} import core.*, core.Decorators.* -import MegaPhase.*, Phases.Phase -import Types.*, Contexts.*, Constants.*, Names.*, NameOps.*, Flags.*, DenotTransformers.* -import SymDenotations.*, Symbols.*, StdNames.*, Annotations.*, Trees.*, Scopes.*, Denotations.* -import TypeErasure.ErasedValueType, ValueClasses.* +import MegaPhase.* +import Types.*, Contexts.*, DenotTransformers.* +import SymDenotations.*, Symbols.*, StdNames.*, Denotations.* /** This phase rewrite PolyFunction subclasses to FunctionN subclasses * diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala index 7414ca7e69c6..472693b83da0 100644 --- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala +++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala @@ -16,7 +16,6 @@ import core.NameOps.* import core.Periods.currentStablePeriod import core.NameKinds.{AdaptedClosureName, BodyRetainerName, DirectMethName} import core.Scopes.newScopeWith -import core.Decorators.* import core.Constants.* import core.Definitions.* import core.Annotations.BodyAnnotation diff --git a/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala b/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala index 2b0c49644b09..f0d76c045782 100644 --- a/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala +++ b/compiler/src/dotty/tools/dotc/transform/EtaReduce.scala @@ -4,7 +4,7 @@ package transform import MegaPhase.MiniPhase import core.* -import Symbols.*, Contexts.*, Types.*, Decorators.* +import Symbols.*, Contexts.*, Decorators.* import StdNames.nme import NameKinds.AdaptedClosureName diff --git a/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala b/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala index 9a6a04621074..14fb159698d1 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala @@ -12,7 +12,6 @@ import Decorators.* import MegaPhase.* import java.io.File.separatorChar -import ValueClasses.* /** Make private term members that are accessed from another class * non-private by resetting the Private flag and expanding their name. diff --git a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala index 67bf1bebed87..ec102cb614b5 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala @@ -3,12 +3,10 @@ package dotc package transform import core.* -import Scopes.newScope -import Contexts.*, Symbols.*, Types.*, Flags.*, Decorators.*, StdNames.*, Constants.* +import Contexts.*, Symbols.*, Types.*, Flags.*, StdNames.*, Constants.* import MegaPhase.* import Names.TypeName -import NullOpsDecorator.* import ast.untpd /** Expand SAM closures that cannot be represented by the JVM as lambdas to anonymous classes. diff --git a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala index c66e6b9471cb..74456c6d4da9 100644 --- a/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala +++ b/compiler/src/dotty/tools/dotc/transform/FirstTransform.scala @@ -18,7 +18,6 @@ import SymDenotations.SymDenotation import NameKinds.OuterSelectName import StdNames.* import config.Feature -import inlines.Inlines.inInlineMethod object FirstTransform { val name: String = "firstTransform" diff --git a/compiler/src/dotty/tools/dotc/transform/ForwardDepChecks.scala b/compiler/src/dotty/tools/dotc/transform/ForwardDepChecks.scala index afe78ce1296d..77b4529f5a3f 100644 --- a/compiler/src/dotty/tools/dotc/transform/ForwardDepChecks.scala +++ b/compiler/src/dotty/tools/dotc/transform/ForwardDepChecks.scala @@ -3,7 +3,7 @@ package dotc package transform import core.* -import Symbols.*, Types.*, Contexts.*, Flags.*, Decorators.*, reporting.* +import Symbols.*, Types.*, Contexts.*, Flags.*, reporting.* import util.Spans.Span import util.Store import collection.immutable diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index 1798d938272c..c4a86c66899f 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -5,7 +5,6 @@ package transform import core.Annotations.* import core.Contexts.* import core.Phases.* -import core.Decorators.* import core.Definitions import core.Flags.* import core.Names.Name @@ -15,8 +14,6 @@ import core.TypeErasure.{erasedGlb, erasure, fullErasure, isGenericArrayElement, import core.Types.* import core.classfile.ClassfileConstants -import config.Printers.transforms -import reporting.trace import java.lang.StringBuilder import scala.annotation.tailrec diff --git a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala index 96cffeb1097d..083dee2865ca 100644 --- a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala +++ b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala @@ -8,7 +8,6 @@ import core.Contexts.* import ast.TreeTypeMap import core.Types.* import core.Flags.* -import core.Decorators.* import collection.mutable import ast.Trees.* import core.NameKinds.SuperArgName diff --git a/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala b/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala index d2a72e10fcfc..3a2a3307f6fe 100644 --- a/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala +++ b/compiler/src/dotty/tools/dotc/transform/InlinePatterns.scala @@ -4,7 +4,7 @@ package transform import core.* import MegaPhase.* -import Symbols.*, Contexts.*, Types.*, Decorators.* +import Contexts.*, Types.*, Decorators.* import NameOps.* import Names.* diff --git a/compiler/src/dotty/tools/dotc/transform/Inlining.scala b/compiler/src/dotty/tools/dotc/transform/Inlining.scala index 751636c7d806..9b52263e0a20 100644 --- a/compiler/src/dotty/tools/dotc/transform/Inlining.scala +++ b/compiler/src/dotty/tools/dotc/transform/Inlining.scala @@ -6,17 +6,12 @@ import ast.Trees.* import ast.TreeMapWithTrackedStats import core.* import Flags.* -import Decorators.* import Contexts.* import Symbols.* -import Decorators.* -import config.Printers.inlining import DenotTransformers.IdentityDenotTransformer import MacroAnnotations.hasMacroAnnotation import inlines.Inlines -import quoted.* import staging.StagingLevel -import util.Property import scala.collection.mutable diff --git a/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala b/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala index 0229284a1b5f..d4d4f93afc0d 100644 --- a/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala +++ b/compiler/src/dotty/tools/dotc/transform/InstrumentCoverage.scala @@ -20,7 +20,6 @@ import util.{SourcePosition, SourceFile} import util.Spans.Span import localopt.StringInterpolatorOpt import inlines.Inlines -import scala.util.matching.Regex import java.util.regex.Pattern /** Implements code coverage by inserting calls to scala.runtime.coverage.Invoker diff --git a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala index e2712a7d6302..1089539f7c77 100644 --- a/compiler/src/dotty/tools/dotc/transform/LazyVals.scala +++ b/compiler/src/dotty/tools/dotc/transform/LazyVals.scala @@ -14,7 +14,6 @@ import core.StdNames.nme import core.Symbols.* import core.Types.* import core.{Names, StdNames} -import dotty.tools.dotc.config.Feature import transform.MegaPhase.MiniPhase import scala.collection.mutable @@ -455,8 +454,6 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer { } def transformMemberDefThreadSafeNew(x: ValOrDefDef)(using Context): Thicket = { - import dotty.tools.dotc.core.Types.* - import dotty.tools.dotc.core.Flags.* val claz = x.symbol.owner.asClass val thizClass = Literal(Constant(claz.info)) diff --git a/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala b/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala index 302001347d67..ed0898d66753 100644 --- a/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala +++ b/compiler/src/dotty/tools/dotc/transform/LetOverApply.scala @@ -3,7 +3,7 @@ package dotc package transform import core.* -import Contexts.*, Symbols.*, Decorators.* +import Contexts.* import MegaPhase.* /** Rewrite `{ stats; expr}.f(args)` to `{ stats; expr.f(args) }` and diff --git a/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala b/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala index fd901032de4b..6558a411b591 100644 --- a/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala +++ b/compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala @@ -13,9 +13,7 @@ import core.DenotTransformers.DenotTransformer import core.Flags.* import core.MacroClassLoader import core.Symbols.* -import core.Types.* import quoted.* -import util.SrcPos import scala.quoted.runtime.impl.{QuotesImpl, SpliceScope} import scala.quoted.Quotes diff --git a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala index 86acd009fd09..4e1af14331c3 100644 --- a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala +++ b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala @@ -5,7 +5,7 @@ package transform import scala.compiletime.uninitialized import core.* -import Contexts.*, Phases.*, Symbols.*, Decorators.* +import Contexts.*, Phases.*, Symbols.* import Flags.PackageVal import staging.StagingLevel.* diff --git a/compiler/src/dotty/tools/dotc/transform/Memoize.scala b/compiler/src/dotty/tools/dotc/transform/Memoize.scala index 0b4d4c7dbf59..4c61d5ce3757 100644 --- a/compiler/src/dotty/tools/dotc/transform/Memoize.scala +++ b/compiler/src/dotty/tools/dotc/transform/Memoize.scala @@ -6,7 +6,6 @@ import DenotTransformers.* import Contexts.* import Phases.* import SymDenotations.SymDenotation -import Denotations.* import Symbols.* import Constants.* diff --git a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala index 6ff81ab13cf1..52ec5d2c929e 100644 --- a/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala +++ b/compiler/src/dotty/tools/dotc/transform/NonLocalReturns.scala @@ -5,7 +5,6 @@ import core.* import Contexts.*, Symbols.*, Types.*, Flags.*, StdNames.* import MegaPhase.* import NameKinds.NonLocalReturnKeyName -import config.SourceVersion.* import Decorators.em import dotty.tools.dotc.config.MigrationVersion diff --git a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala index 6529eed77fa0..5242822aeb96 100644 --- a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala +++ b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala @@ -3,7 +3,7 @@ package dotc package transform import core.* -import Flags.*, Symbols.*, Contexts.*, Scopes.*, Decorators.*, Types.Type +import Flags.*, Symbols.*, Contexts.*, Scopes.*, Types.Type import NameKinds.DefaultGetterName import NullOpsDecorator.* import collection.immutable.BitSet diff --git a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala index 624ec9628d87..26ca28ae8ce5 100644 --- a/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala +++ b/compiler/src/dotty/tools/dotc/transform/PickleQuotes.scala @@ -9,20 +9,17 @@ import Contexts.* import Symbols.* import Constants.* import ast.Trees.* -import ast.untpd import ast.TreeTypeMap import NameKinds.* import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.ast.untpd -import dotty.tools.dotc.config.ScalaRelease.* import dotty.tools.dotc.core.Annotations.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.quoted.* import dotty.tools.dotc.inlines.Inlines -import scala.annotation.constructorOnly import scala.collection.mutable /** Translates quoted terms and types to `unpickleExprV2` or `unpickleType` method calls. @@ -69,7 +66,6 @@ import scala.collection.mutable * */ class PickleQuotes extends MacroTransform { - import PickleQuotes.* import tpd.* override def phaseName: String = PickleQuotes.name diff --git a/compiler/src/dotty/tools/dotc/transform/Pickler.scala b/compiler/src/dotty/tools/dotc/transform/Pickler.scala index c8c071064ab8..dbfa3cb30608 100644 --- a/compiler/src/dotty/tools/dotc/transform/Pickler.scala +++ b/compiler/src/dotty/tools/dotc/transform/Pickler.scala @@ -17,8 +17,7 @@ import Symbols.* import Flags.Module import reporting.{ThrowingReporter, Profile, Message} import collection.mutable -import util.concurrent.{Executor, Future} -import compiletime.uninitialized +import util.concurrent.Executor import dotty.tools.io.{JarArchive, AbstractFile} import dotty.tools.dotc.printing.OutlinePrinter import scala.annotation.constructorOnly @@ -26,7 +25,7 @@ import scala.concurrent.Promise import dotty.tools.dotc.transform.Pickler.writeSigFilesAsync import scala.util.chaining.given -import dotty.tools.io.FileWriters.{EagerReporter, BufferingReporter} +import dotty.tools.io.FileWriters.BufferingReporter import dotty.tools.dotc.sbt.interfaces.IncrementalCallback import dotty.tools.dotc.sbt.asyncZincPhasesCompleted import scala.concurrent.ExecutionContext diff --git a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala index 898517806e50..29a973b00d68 100644 --- a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala +++ b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala @@ -2,8 +2,7 @@ package dotty.tools package dotc package transform -import dotty.tools.dotc.ast.{Trees, tpd, untpd, desugar, TreeTypeMap} -import scala.collection.mutable +import dotty.tools.dotc.ast.{Trees, tpd, desugar, TreeTypeMap} import core.* import dotty.tools.dotc.typer.Checking import dotty.tools.dotc.inlines.Inlines @@ -12,11 +11,11 @@ import typer.ErrorReporting.errorTree import Types.*, Contexts.*, Names.*, Flags.*, DenotTransformers.*, Phases.* import SymDenotations.*, StdNames.*, Annotations.*, Trees.*, Scopes.* import Decorators.* -import Symbols.*, NameOps.* +import Symbols.* import ContextFunctionResults.annotateContextResults import config.Printers.typr import config.Feature -import util.{SrcPos, Stats} +import util.Stats import reporting.* import NameKinds.WildcardParamName import cc.* diff --git a/compiler/src/dotty/tools/dotc/transform/PreRecheck.scala b/compiler/src/dotty/tools/dotc/transform/PreRecheck.scala index ba60d3b97adc..ded3f103d432 100644 --- a/compiler/src/dotty/tools/dotc/transform/PreRecheck.scala +++ b/compiler/src/dotty/tools/dotc/transform/PreRecheck.scala @@ -3,7 +3,7 @@ package transform import core.Phases.Phase import core.DenotTransformers.DenotTransformer -import core.Contexts.{Context, ctx} +import core.Contexts.Context /** A base class for a phase that precedes a rechecker and that allows installing * new types for local symbols. diff --git a/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala b/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala index 47eb70cb46d4..0411a412f8a4 100644 --- a/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala +++ b/compiler/src/dotty/tools/dotc/transform/PruneErasedDefs.scala @@ -13,7 +13,6 @@ import ast.tpd import reporting.InlinedAnonClassWarning import config.Feature -import Decorators.* import dotty.tools.dotc.core.Types.MethodType /** This phase makes all erased term members of classes private so that they cannot diff --git a/compiler/src/dotty/tools/dotc/transform/PureStats.scala b/compiler/src/dotty/tools/dotc/transform/PureStats.scala index 22fdef3aaab6..583573058d3a 100644 --- a/compiler/src/dotty/tools/dotc/transform/PureStats.scala +++ b/compiler/src/dotty/tools/dotc/transform/PureStats.scala @@ -2,10 +2,10 @@ package dotty.tools.dotc package transform import ast.{Trees, tpd} -import core.*, core.Decorators.* +import core.* import MegaPhase.* -import Types.*, Contexts.*, Flags.*, DenotTransformers.* -import Symbols.*, StdNames.*, Trees.* +import Contexts.* +import Symbols.*, Trees.* object PureStats { val name: String = "pureStats" diff --git a/compiler/src/dotty/tools/dotc/transform/Recheck.scala b/compiler/src/dotty/tools/dotc/transform/Recheck.scala index 8936c460de81..cbdd1faab5b1 100644 --- a/compiler/src/dotty/tools/dotc/transform/Recheck.scala +++ b/compiler/src/dotty/tools/dotc/transform/Recheck.scala @@ -4,7 +4,7 @@ package transform import core.* import Symbols.*, Contexts.*, Types.*, ContextOps.*, Decorators.*, SymDenotations.* -import Flags.*, NameKinds.*, Denotations.{Denotation, SingleDenotation} +import Flags.*, NameKinds.*, Denotations.Denotation import ast.* import Names.Name import Phases.Phase @@ -19,11 +19,9 @@ import typer.ErrorReporting.{Addenda, NothingToAdd} import config.Printers.recheckr import util.Property import StdNames.nme -import reporting.trace import annotation.constructorOnly import cc.CaptureSet.IdempotentCaptRefMap import annotation.tailrec -import dotty.tools.dotc.cc.boxed object Recheck: import tpd.* diff --git a/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala b/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala index f1603db0e5a0..a92f598416ac 100644 --- a/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala +++ b/compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala @@ -2,23 +2,15 @@ package dotty.tools.dotc package transform import core.* -import Decorators.* -import Flags.* import Types.* import Contexts.* import Symbols.* -import NameKinds.* import dotty.tools.dotc.ast.tpd import tpd.* -import scala.collection.mutable -import dotty.tools.dotc.core.Annotations.* -import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.StdNames.* -import dotty.tools.dotc.quoted.* -import scala.annotation.constructorOnly /** Helper methods to construct trees calling methods in `Quotes.reflect` based on the current `quotes` tree */ trait ReifiedReflect: diff --git a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala index 6bc5db79fee5..dbad695aea1d 100644 --- a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala +++ b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala @@ -12,7 +12,6 @@ import DenotTransformers.* import Names.* import NameOps.* import NameKinds.* -import NullOpsDecorator.* import ResolveSuper.* import reporting.IllegalSuperAccessor diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala index fd314b94e50c..af9740155f8b 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeApplyMethods.scala @@ -1,9 +1,9 @@ package dotty.tools.dotc package transform -import ast.Trees.*, ast.tpd, core.* -import Contexts.*, Types.*, Decorators.*, Symbols.*, DenotTransformers.* -import SymDenotations.*, Scopes.*, StdNames.*, NameOps.*, Names.* +import core.* +import Contexts.*, Types.*, Symbols.*, DenotTransformers.* +import StdNames.*, NameOps.*, Names.* import MegaPhase.MiniPhase import scala.collection.mutable diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala index 43aef6279cec..604d3f315d5d 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala @@ -2,8 +2,8 @@ package dotty.tools.dotc package transform import ast.Trees.*, ast.tpd, core.* -import Contexts.*, Types.*, Decorators.*, Symbols.*, DenotTransformers.* -import SymDenotations.*, Scopes.*, StdNames.*, NameOps.*, Names.*, NameKinds.* +import Contexts.*, Types.*, Symbols.* +import StdNames.*, NameOps.*, Names.*, NameKinds.* import MegaPhase.MiniPhase diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeTuples.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeTuples.scala index 264659930505..d10372f861c4 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeTuples.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeTuples.scala @@ -3,8 +3,8 @@ package dotc package transform import ast.Trees.*, ast.tpd, core.* -import Contexts.*, Types.*, Decorators.*, Symbols.*, DenotTransformers.* -import SymDenotations.*, Scopes.*, StdNames.*, NameOps.*, Names.* +import Contexts.*, Types.*, Symbols.* +import StdNames.*, NameOps.* import MegaPhase.MiniPhase import inlines.Inliner.isElideableExpr diff --git a/compiler/src/dotty/tools/dotc/transform/Splicer.scala b/compiler/src/dotty/tools/dotc/transform/Splicer.scala index b5386d5bd1df..5ea713e5568e 100644 --- a/compiler/src/dotty/tools/dotc/transform/Splicer.scala +++ b/compiler/src/dotty/tools/dotc/transform/Splicer.scala @@ -3,27 +3,20 @@ package transform import scala.language.unsafeNulls -import java.io.{PrintWriter, StringWriter} -import java.lang.reflect.{InvocationTargetException, Method => JLRMethod} import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.Flags.* -import dotty.tools.dotc.core.NameKinds.FlatName -import dotty.tools.dotc.core.Names.Name import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.core.Symbols.* -import dotty.tools.dotc.core.Denotations.staticRef -import dotty.tools.dotc.core.TypeErasure import dotty.tools.dotc.core.Constants.Constant import dotty.tools.dotc.quoted.Interpreter import scala.util.control.NonFatal import dotty.tools.dotc.util.SrcPos -import dotty.tools.repl.AbstractFileClassLoader import scala.reflect.ClassTag diff --git a/compiler/src/dotty/tools/dotc/transform/Splicing.scala b/compiler/src/dotty/tools/dotc/transform/Splicing.scala index 967c1cb6d19b..4a8066375410 100644 --- a/compiler/src/dotty/tools/dotc/transform/Splicing.scala +++ b/compiler/src/dotty/tools/dotc/transform/Splicing.scala @@ -7,10 +7,7 @@ import Flags.* import Types.* import Contexts.* import Symbols.* -import Constants.* import ast.Trees.* -import ast.{TreeTypeMap, untpd} -import util.Spans.* import NameKinds.* import dotty.tools.dotc.ast.tpd @@ -19,13 +16,9 @@ import scala.collection.mutable import dotty.tools.dotc.core.Annotations.* import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.StdNames.* -import dotty.tools.dotc.quoted.* -import dotty.tools.dotc.config.ScalaRelease.* import dotty.tools.dotc.staging.StagingLevel.* -import dotty.tools.dotc.staging.QuoteTypeTags import dotty.tools.dotc.staging.QuoteTypeTags.* -import scala.annotation.constructorOnly object Splicing: val name: String = "splicing" diff --git a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala index 5a63235fc3c0..6c4aea09a1c3 100644 --- a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala +++ b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala @@ -6,7 +6,7 @@ import dotty.tools.dotc.ast.{Trees, tpd} import scala.collection.mutable import ValueClasses.isMethodWithExtension import core.* -import Contexts.*, Flags.*, Symbols.*, Names.*, StdNames.*, NameOps.*, Trees.* +import Contexts.*, Flags.*, Names.*, StdNames.*, NameOps.*, Trees.* import DenotTransformers.DenotTransformer import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index a8c8ec8ce1d8..8908e381ae8b 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 ast.untpd import Erasure.Boxing.* import TypeErasure.* @@ -15,7 +14,6 @@ import util.Spans.* import reporting.* import config.Printers.{ transforms => debug } -import patmat.Typ import dotty.tools.dotc.util.SrcPos /** This transform normalizes type tests and type casts, diff --git a/compiler/src/dotty/tools/dotc/transform/VCElideAllocations.scala b/compiler/src/dotty/tools/dotc/transform/VCElideAllocations.scala index 6430dd7248b1..39f2029e9190 100644 --- a/compiler/src/dotty/tools/dotc/transform/VCElideAllocations.scala +++ b/compiler/src/dotty/tools/dotc/transform/VCElideAllocations.scala @@ -5,7 +5,7 @@ import ast.tpd import core.* import Contexts.*, Symbols.*, Types.*, Flags.*, Phases.* import DenotTransformers.*, MegaPhase.* -import TreeExtractors.*, ValueClasses.* +import TreeExtractors.* /** This phase elides unnecessary value class allocations * diff --git a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala index 4d5c467cf4fe..1f488c8a03b6 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala @@ -8,7 +8,6 @@ import tpd.* import dotty.tools.dotc.core.* import Contexts.* -import Types.* import Symbols.* import StdNames.* @@ -17,7 +16,6 @@ import Phases.* import scala.collection.mutable -import Semantic.* import dotty.tools.unsupported class Checker extends Phase: diff --git a/compiler/src/dotty/tools/dotc/transform/init/Errors.scala b/compiler/src/dotty/tools/dotc/transform/init/Errors.scala index 85feb609c90a..29ad5a2d6c71 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Errors.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Errors.scala @@ -7,7 +7,7 @@ import ast.tpd.* import core.* import util.Property import util.SourcePosition -import Types.*, Symbols.*, Contexts.* +import Symbols.*, Contexts.* import Trace.Trace diff --git a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala index 61d96770ea55..807dd667b28d 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala @@ -20,7 +20,6 @@ import reporting.StoreReporter import reporting.trace as log import typer.Applications.* -import Errors.* import Trace.* import Util.* diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index 1ee402deded0..418c266f10c1 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -5,9 +5,8 @@ package patmat import core.* import Constants.*, Contexts.*, Decorators.*, Flags.*, NullOpsDecorator.*, Symbols.*, Types.* -import Names.*, NameOps.*, StdNames.* +import Names.*, StdNames.* import ast.*, tpd.* -import config.Printers.exhaustivity import printing.{ Printer, * }, Texts.* import reporting.* import typer.*, Applications.*, Inferencing.*, ProtoTypes.* diff --git a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala index c7316482c193..41f476f3fcf3 100644 --- a/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala +++ b/compiler/src/dotty/tools/dotc/transform/sjs/PrepJSInterop.scala @@ -14,7 +14,7 @@ import Contexts.* import Decorators.* import DenotTransformers.* import Flags.* -import NameKinds.{DefaultGetterName, ModuleClassName} +import NameKinds.DefaultGetterName import NameOps.* import StdNames.* import Symbols.* diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 98bfbe69ff8c..b6b6ed52eef8 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -34,7 +34,6 @@ import Constants.{Constant, IntTag} import Denotations.SingleDenotation import annotation.threadUnsafe -import scala.util.control.NonFatal import dotty.tools.dotc.inlines.Inlines object Applications { diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 3a2f16438c88..4ca58270200d 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -15,7 +15,6 @@ import ProtoTypes.* import Scopes.* import CheckRealizable.* import ErrorReporting.errorTree -import util.Spans.Span import Phases.refchecksPhase import Constants.Constant @@ -24,7 +23,7 @@ import util.Spans.Span import rewrites.Rewrites.patch import inlines.Inlines import Decorators.* -import ErrorReporting.{err, errorType} +import ErrorReporting.errorType import config.Printers.{typr, patmatch} import NameKinds.DefaultGetterName import NameOps.* diff --git a/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala b/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala index 6020431672b9..3da3e8a66f22 100644 --- a/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/CrossVersionChecks.scala @@ -6,7 +6,7 @@ import core.* import Annotations.Annotation import Symbols.*, Types.*, Contexts.*, Flags.*, Decorators.*, reporting.* import util.SrcPos -import config.{ScalaVersion, NoScalaVersion, Feature, ScalaRelease} +import config.{ScalaVersion, NoScalaVersion, Feature} import MegaPhase.MiniPhase import scala.util.{Failure, Success} import ast.tpd diff --git a/compiler/src/dotty/tools/dotc/typer/Deriving.scala b/compiler/src/dotty/tools/dotc/typer/Deriving.scala index 60148319a61c..cd061a158de6 100644 --- a/compiler/src/dotty/tools/dotc/typer/Deriving.scala +++ b/compiler/src/dotty/tools/dotc/typer/Deriving.scala @@ -6,7 +6,7 @@ import core.* import ast.* import ast.Trees.* import StdNames.* -import Contexts.*, Symbols.*, Types.*, SymDenotations.*, Names.*, NameOps.*, Flags.*, Decorators.* +import Contexts.*, Symbols.*, Types.*, Names.*, Flags.*, Decorators.* import ProtoTypes.*, ContextOps.* import util.Spans.* import util.SrcPos diff --git a/compiler/src/dotty/tools/dotc/typer/Docstrings.scala b/compiler/src/dotty/tools/dotc/typer/Docstrings.scala index 33ef3e85e14e..f0511edeb07a 100644 --- a/compiler/src/dotty/tools/dotc/typer/Docstrings.scala +++ b/compiler/src/dotty/tools/dotc/typer/Docstrings.scala @@ -3,7 +3,7 @@ package dotc package typer import core.* -import Contexts.*, Symbols.*, Decorators.*, Comments.{_, given} +import Contexts.*, Symbols.*, Decorators.*, Comments._ import ast.tpd object Docstrings { diff --git a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala index 14cc7bf963a6..7cb77a6a0ce4 100644 --- a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala +++ b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala @@ -7,7 +7,6 @@ import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.ast.untpd import dotty.tools.dotc.core.Constants.Constant import dotty.tools.dotc.core.Contexts.* -import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Mode import dotty.tools.dotc.core.Names.{Name, TermName} import dotty.tools.dotc.core.StdNames.* diff --git a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala index 13e75be75838..7dbc9632a4c6 100644 --- a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala +++ b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala @@ -7,10 +7,8 @@ import core.* import Types.*, ProtoTypes.*, Contexts.*, Decorators.*, Denotations.*, Symbols.* import Implicits.*, Flags.*, Constants.Constant import Trees.* -import NameOps.* import util.Spans.NoSpan import util.SrcPos -import config.Feature import reporting.* import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index 9d273ebca866..de96a17a048f 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -10,7 +10,6 @@ import util.Stats.{record, monitored} import printing.{Showable, Printer} import printing.Texts.* import Contexts.* -import Types.* import Flags.* import Mode.ImplicitsEnabled import NameKinds.{LazyImplicitName, ContextBoundParamName} @@ -22,7 +21,6 @@ import StdNames.* import ProtoTypes.* import ErrorReporting.* import Inferencing.{fullyDefinedType, isFullyDefined} -import Scopes.newScope import Typer.BindingPrec, BindingPrec.* import Hashable.* import util.{EqHashMap, Stats} diff --git a/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala b/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala index 78cba674bfff..a90b15b7749d 100644 --- a/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala +++ b/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala @@ -6,7 +6,7 @@ import ast.{tpd, untpd} import core.* import printing.{Printer, Showable} import util.SimpleIdentityMap -import Symbols.*, Names.*, Types.*, Contexts.*, StdNames.*, Flags.* +import Symbols.*, Names.*, Types.*, Contexts.*, Flags.* import Implicits.RenamedImplicitRef import StdNames.nme import printing.Texts.Text diff --git a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala index 2ebcd96d5bde..41dae5b21a0b 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala @@ -8,10 +8,9 @@ import Contexts.*, Types.*, Flags.*, Symbols.* import ProtoTypes.* import NameKinds.UniqueName import util.Spans.* -import util.{Stats, SimpleIdentityMap, SimpleIdentitySet, SrcPos} +import util.{Stats, SimpleIdentitySet, SrcPos} import Decorators._ import config.Printers.{gadts, typr} -import annotation.tailrec import reporting.* import collection.mutable import scala.annotation.internal.sharable diff --git a/compiler/src/dotty/tools/dotc/typer/Migrations.scala b/compiler/src/dotty/tools/dotc/typer/Migrations.scala index f0d1d235a19c..75232b197631 100644 --- a/compiler/src/dotty/tools/dotc/typer/Migrations.scala +++ b/compiler/src/dotty/tools/dotc/typer/Migrations.scala @@ -14,7 +14,7 @@ import Trees.* import ProtoTypes.* import Decorators.* import config.MigrationVersion as mv -import config.Feature.{sourceVersion, migrateTo3} +import config.Feature.sourceVersion import config.SourceVersion.* import reporting.* import NameKinds.ContextBoundParamName diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 21ef0fc5d123..1d4882f3f36e 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -6,7 +6,7 @@ import core.* import ast.* import Trees.*, StdNames.*, Scopes.*, Denotations.*, NamerOps.*, ContextOps.* import Contexts.*, Symbols.*, Types.*, SymDenotations.*, Names.*, NameOps.*, Flags.* -import Decorators.*, Comments.{_, given} +import Decorators.*, Comments._ import NameKinds.DefaultGetterName import ast.desugar, ast.desugar.* import ProtoTypes.* @@ -23,7 +23,6 @@ import parsing.Parsers.Parser import Annotations.* import Inferencing.* import Nullables.* -import transform.ValueClasses.* import TypeErasure.erasure import reporting.* import config.Feature.{sourceVersion, modularity} diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index 59993a69797d..a7817abaa259 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -2,14 +2,11 @@ package dotty.tools.dotc package typer import dotty.tools.dotc.ast.* -import dotty.tools.dotc.config.Feature.* -import dotty.tools.dotc.config.SourceVersion.* import dotty.tools.dotc.core.* import dotty.tools.dotc.core.Annotations.* import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.Flags.* -import dotty.tools.dotc.core.NameKinds.PatMatGivenVarName import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Symbols.* @@ -25,8 +22,6 @@ import dotty.tools.dotc.util.Property import dotty.tools.dotc.util.Spans.* import dotty.tools.dotc.util.Stats.record import dotty.tools.dotc.reporting.IllegalVariableInPatternAlternative -import scala.collection.mutable -import scala.collection.SeqMap /** Type quotes `'{ ... }` and splices `${ ... }` */ trait QuotesAndSplices { diff --git a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala index ed8919661860..7fbb82461da7 100644 --- a/compiler/src/dotty/tools/dotc/typer/ReTyper.scala +++ b/compiler/src/dotty/tools/dotc/typer/ReTyper.scala @@ -9,7 +9,6 @@ import StdNames.* import Decorators.* import typer.ProtoTypes.* import ast.{tpd, untpd} -import scala.util.control.NonFatal import util.Spans.Span import Nullables.* import staging.StagingLevel.* diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index dcdabaf3a72d..85d2b4144d87 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -11,11 +11,11 @@ import util.Spans.* import scala.collection.{mutable, immutable} import ast.* import MegaPhase.* -import config.Printers.{checks, noPrinter, capt} +import config.Printers.{checks, noPrinter} import Decorators.* import OverridingPairs.isOverridingPair import typer.ErrorReporting.* -import config.Feature.{warnOnMigration, migrateTo3, sourceVersion} +import config.Feature.{warnOnMigration, migrateTo3} import config.SourceVersion.`3.0` import config.MigrationVersion import config.Printers.refcheck diff --git a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala index c935e8d6b3cf..af365c835f65 100644 --- a/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala @@ -12,13 +12,11 @@ import ProtoTypes.* import Inferencing.{fullyDefinedType, isFullyDefined} import ast.untpd import transform.SyntheticMembers.* -import util.Property import ast.Trees.genericEmptyTree import annotation.{tailrec, constructorOnly} import ast.tpd import ast.tpd.* import Synthesizer.* -import sbt.ExtractDependencies.* import xsbti.api.DependencyContext.* /** Synthesize terms for special classes */ diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala index 6ce0f5f2517c..8c03f3d785d5 100644 --- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -10,8 +10,7 @@ import util.SrcPos import NameOps.* import collection.mutable import reporting.* -import Checking.{checkNoPrivateLeaks, checkNoWildcard} -import cc.CaptureSet +import Checking.checkNoPrivateLeaks trait TypeAssigner { import tpd.* diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 9b7e4fe36668..8e170586e6ec 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -33,7 +33,7 @@ import inlines.{Inlines, PrepareInlineable} import util.Spans.* import util.common.* import util.{Property, SimpleIdentityMap, SrcPos} -import Applications.{tupleComponentTypes, wrapDefs, defaultArgument} +import Applications.{wrapDefs, defaultArgument} import collection.mutable import annotation.tailrec @@ -48,7 +48,6 @@ import reporting.* import Nullables.* import NullOpsDecorator.* import cc.{CheckCaptures, isRetainsLike} -import config.Config import config.MigrationVersion import transform.CheckUnused.OriginalName diff --git a/compiler/src/dotty/tools/dotc/util/EqHashSet.scala b/compiler/src/dotty/tools/dotc/util/EqHashSet.scala index d584441fd00a..1067a432b59b 100644 --- a/compiler/src/dotty/tools/dotc/util/EqHashSet.scala +++ b/compiler/src/dotty/tools/dotc/util/EqHashSet.scala @@ -22,7 +22,6 @@ object EqHashSet: * once the number of elements reaches the table's size. */ class EqHashSet[T](initialCapacity: Int = 8, capacityMultiple: Int = 2) extends GenericHashSet[T](initialCapacity, capacityMultiple) { - import GenericHashSet.DenseLimit /** System's identity hashcode left shifted by 1 */ final def hash(key: T): Int = diff --git a/compiler/src/dotty/tools/dotc/util/HashSet.scala b/compiler/src/dotty/tools/dotc/util/HashSet.scala index 3a973793d542..aad77036b775 100644 --- a/compiler/src/dotty/tools/dotc/util/HashSet.scala +++ b/compiler/src/dotty/tools/dotc/util/HashSet.scala @@ -22,7 +22,6 @@ object HashSet: * once the number of elements reaches the table's size. */ class HashSet[T](initialCapacity: Int = 8, capacityMultiple: Int = 2) extends GenericHashSet[T](initialCapacity, capacityMultiple) { - import GenericHashSet.DenseLimit /** Hashcode, by default a processed `x.hashCode`, can be overridden */ protected def hash(key: T): Int = diff --git a/compiler/src/dotty/tools/dotc/util/Signatures.scala b/compiler/src/dotty/tools/dotc/util/Signatures.scala index 3b45d8f2fa51..8e80ad41e09f 100644 --- a/compiler/src/dotty/tools/dotc/util/Signatures.scala +++ b/compiler/src/dotty/tools/dotc/util/Signatures.scala @@ -6,7 +6,6 @@ import dotty.tools.dotc.ast.Positioned import dotty.tools.dotc.ast.untpd import dotty.tools.dotc.core.NameOps.* import dotty.tools.dotc.core.StdNames.nme -import dotty.tools.dotc.core.Symbols.defn import ast.Trees.* import ast.tpd @@ -16,7 +15,7 @@ import core.Flags import core.Names.* import core.NameKinds import core.Types.* -import core.Symbols.{NoSymbol, isLocalToBlock} +import core.Symbols.isLocalToBlock import interactive.Interactive import util.Spans.Span import reporting.* diff --git a/compiler/src/dotty/tools/dotc/util/SourceFile.scala b/compiler/src/dotty/tools/dotc/util/SourceFile.scala index 3ea43d16a7c8..3af812fe50cb 100644 --- a/compiler/src/dotty/tools/dotc/util/SourceFile.scala +++ b/compiler/src/dotty/tools/dotc/util/SourceFile.scala @@ -11,7 +11,6 @@ import core.Contexts.* import scala.io.Codec import Chars.* import scala.annotation.internal.sharable -import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.compiletime.uninitialized import scala.util.chaining.given @@ -21,7 +20,6 @@ import java.net.URI import java.nio.charset.StandardCharsets import java.nio.file.{FileSystemException, NoSuchFileException, Paths} import java.util.Optional -import java.util.concurrent.atomic.AtomicInteger import java.util.regex.Pattern object ScriptSourceFile { @@ -62,7 +60,6 @@ object ScriptSourceFile { } class SourceFile(val file: AbstractFile, computeContent: => Array[Char]) extends interfaces.SourceFile { - import SourceFile.* private var myContent: Array[Char] | Null = null diff --git a/compiler/src/dotty/tools/dotc/util/concurrent.scala b/compiler/src/dotty/tools/dotc/util/concurrent.scala index 2710aae6c9b0..b3460d329152 100644 --- a/compiler/src/dotty/tools/dotc/util/concurrent.scala +++ b/compiler/src/dotty/tools/dotc/util/concurrent.scala @@ -1,5 +1,5 @@ package dotty.tools.dotc.util -import scala.util.{Try, Failure, Success} +import scala.util.{Try, Failure} import scala.collection.mutable.ArrayBuffer object concurrent: diff --git a/compiler/src/dotty/tools/io/FileExtension.scala b/compiler/src/dotty/tools/io/FileExtension.scala index 3aeef5b902ce..c7c4143dc977 100644 --- a/compiler/src/dotty/tools/io/FileExtension.scala +++ b/compiler/src/dotty/tools/io/FileExtension.scala @@ -1,6 +1,5 @@ package dotty.tools.io -import dotty.tools.uncheckedNN import dotty.tools.dotc.util.EnumFlags.FlagSet enum FileExtension(val toLowerCase: String): diff --git a/compiler/src/dotty/tools/io/FileWriters.scala b/compiler/src/dotty/tools/io/FileWriters.scala index 5fdf43cfe8e3..81a67de8dabf 100644 --- a/compiler/src/dotty/tools/io/FileWriters.scala +++ b/compiler/src/dotty/tools/io/FileWriters.scala @@ -4,7 +4,6 @@ import scala.language.unsafeNulls import dotty.tools.io.AbstractFile import dotty.tools.io.JarArchive -import dotty.tools.io.PlainFile import java.io.BufferedOutputStream import java.io.DataOutputStream @@ -24,7 +23,6 @@ import java.util.zip.CRC32 import java.util.zip.Deflater import java.util.zip.ZipEntry import java.util.zip.ZipOutputStream -import scala.collection.mutable import dotty.tools.dotc.core.Contexts, Contexts.Context import dotty.tools.dotc.core.Decorators.em @@ -35,7 +33,6 @@ import dotty.tools.dotc.reporting.Message import dotty.tools.dotc.report import dotty.tools.backend.jvm.PostProcessorFrontendAccess.BackendReporting -import scala.annotation.constructorOnly import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicBoolean import java.util.ConcurrentModificationException diff --git a/compiler/src/dotty/tools/repl/Rendering.scala b/compiler/src/dotty/tools/repl/Rendering.scala index c127cc959e25..9018db0b9efa 100644 --- a/compiler/src/dotty/tools/repl/Rendering.scala +++ b/compiler/src/dotty/tools/repl/Rendering.scala @@ -4,7 +4,7 @@ package repl import scala.language.unsafeNulls import dotc.*, core.* -import Contexts.*, Denotations.*, Flags.*, NameOps.*, StdNames.*, Symbols.* +import Contexts.*, Denotations.*, StdNames.*, Symbols.* import printing.ReplPrinter import reporting.Diagnostic import util.StackTraceOps.* diff --git a/compiler/src/dotty/tools/runner/ScalaClassLoader.scala b/compiler/src/dotty/tools/runner/ScalaClassLoader.scala index a8cd36cba6bd..e6842a8893a7 100644 --- a/compiler/src/dotty/tools/runner/ScalaClassLoader.scala +++ b/compiler/src/dotty/tools/runner/ScalaClassLoader.scala @@ -4,7 +4,6 @@ package runner import scala.language.unsafeNulls import java.lang.ClassLoader -import java.lang.invoke.{MethodHandles, MethodType} import java.lang.reflect.Modifier import java.net.{ URL, URLClassLoader } import java.lang.reflect.{ InvocationTargetException, UndeclaredThrowableException } diff --git a/compiler/src/dotty/tools/tasty/besteffort/BestEffortTastyHeaderUnpickler.scala b/compiler/src/dotty/tools/tasty/besteffort/BestEffortTastyHeaderUnpickler.scala index 4325f55be4a7..7fb25c5a7038 100644 --- a/compiler/src/dotty/tools/tasty/besteffort/BestEffortTastyHeaderUnpickler.scala +++ b/compiler/src/dotty/tools/tasty/besteffort/BestEffortTastyHeaderUnpickler.scala @@ -2,8 +2,8 @@ package dotty.tools.tasty.besteffort import java.util.UUID -import BestEffortTastyFormat.{MajorVersion, MinorVersion, ExperimentalVersion, bestEffortHeader, header} -import dotty.tools.tasty.{UnpicklerConfig, TastyHeaderUnpickler, TastyReader, UnpickleException, TastyFormat, TastyVersion} +import BestEffortTastyFormat.{bestEffortHeader, header} +import dotty.tools.tasty.{UnpicklerConfig, TastyReader, UnpickleException, TastyFormat, TastyVersion} /** * The Best Effort Tasty Header consists of six fields: diff --git a/compiler/src/scala/quoted/runtime/impl/ExprCastException.scala b/compiler/src/scala/quoted/runtime/impl/ExprCastException.scala index ba870808cee3..e03175913e3e 100644 --- a/compiler/src/scala/quoted/runtime/impl/ExprCastException.scala +++ b/compiler/src/scala/quoted/runtime/impl/ExprCastException.scala @@ -1,7 +1,5 @@ package scala.quoted.runtime.impl -import dotty.tools.dotc.ast.tpd.Tree -import dotty.tools.dotc.core.Contexts.* class ExprCastException(msg: String) extends Exception(msg) diff --git a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala index 3790174526b3..2eff70a4da6b 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala @@ -3,7 +3,6 @@ package runtime.impl import dotty.tools.dotc.ast.tpd import dotty.tools.dotc.core.Contexts.* -import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Names.* import dotty.tools.dotc.core.Mode.GadtConstraintInference diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index fd5b635e11e2..49374772bcc4 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -10,7 +10,6 @@ import dotty.tools.dotc.core.Annotations import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.* import dotty.tools.dotc.core.NameKinds -import dotty.tools.dotc.core.NameOps.* import dotty.tools.dotc.core.StdNames.* import dotty.tools.dotc.core.Types import dotty.tools.dotc.NoCompilationUnit @@ -23,7 +22,6 @@ import scala.quoted.runtime.{QuoteUnpickler, QuoteMatching} import scala.quoted.runtime.impl.printers.* import scala.reflect.TypeTest -import dotty.tools.dotc.core.NameKinds.ExceptionBinderName import dotty.tools.dotc.transform.TreeChecker object QuotesImpl { @@ -2526,7 +2524,6 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler object Implicits extends ImplicitsModule: def search(tpe: TypeRepr): ImplicitSearchResult = - import tpd.TreeOps val implicitTree = ctx.typer.inferImplicitArg(tpe, Position.ofMacroExpansion.span) // Make sure that we do not have any uninstantiated type variables. // See tests/pos-macros/i16636. diff --git a/library/src/scala/CanThrow.scala b/library/src/scala/CanThrow.scala index 91c94229c43c..913ac090c238 100644 --- a/library/src/scala/CanThrow.scala +++ b/library/src/scala/CanThrow.scala @@ -1,6 +1,6 @@ package scala import language.experimental.erasedDefinitions -import annotation.{implicitNotFound, experimental, capability} +import annotation.{implicitNotFound, experimental} /** A capability class that allows to throw exception `E`. When used with the * experimental.saferExceptions feature, a `throw Ex()` expression will require diff --git a/library/src/scala/NamedTuple.scala b/library/src/scala/NamedTuple.scala index 0d1deffce513..1361ec538212 100644 --- a/library/src/scala/NamedTuple.scala +++ b/library/src/scala/NamedTuple.scala @@ -1,6 +1,5 @@ package scala import annotation.experimental -import compiletime.ops.boolean.* @experimental object NamedTuple: diff --git a/library/src/scala/Tuple.scala b/library/src/scala/Tuple.scala index 57d1572772e2..01f4a19e5057 100644 --- a/library/src/scala/Tuple.scala +++ b/library/src/scala/Tuple.scala @@ -1,7 +1,6 @@ package scala import annotation.showAsInfix -import compiletime.* import compiletime.ops.int.* /** Tuple of arbitrary arity */ diff --git a/library/src/scala/compiletime/package.scala b/library/src/scala/compiletime/package.scala index 8215ae2452a3..be76941a680b 100644 --- a/library/src/scala/compiletime/package.scala +++ b/library/src/scala/compiletime/package.scala @@ -1,7 +1,7 @@ package scala package compiletime -import annotation.{compileTimeOnly, experimental} +import annotation.compileTimeOnly /** Use this method when you have a type, do not have a value for it but want to * pattern match on it. For example, given a type `Tup <: Tuple`, one can diff --git a/library/src/scala/quoted/Type.scala b/library/src/scala/quoted/Type.scala index b035bdd6e52f..33423b86080b 100644 --- a/library/src/scala/quoted/Type.scala +++ b/library/src/scala/quoted/Type.scala @@ -1,6 +1,6 @@ package scala.quoted -import scala.annotation.{compileTimeOnly, experimental} +import scala.annotation.compileTimeOnly /** Type (or type constructor) `T` needed contextually when using `T` in a quoted expression `'{... T ...}` */ abstract class Type[T <: AnyKind] private[scala]: diff --git a/library/src/scala/quoted/runtime/Expr.scala b/library/src/scala/quoted/runtime/Expr.scala index b95f225c13b3..f491ba61b382 100644 --- a/library/src/scala/quoted/runtime/Expr.scala +++ b/library/src/scala/quoted/runtime/Expr.scala @@ -1,7 +1,7 @@ package scala.quoted package runtime -import scala.annotation.{Annotation, compileTimeOnly} +import scala.annotation.compileTimeOnly @compileTimeOnly("Illegal reference to `scala.quoted.runtime.Expr`") object Expr: diff --git a/library/src/scala/runtime/coverage/Invoker.scala b/library/src/scala/runtime/coverage/Invoker.scala index b3216ec37c67..2613a41a5541 100644 --- a/library/src/scala/runtime/coverage/Invoker.scala +++ b/library/src/scala/runtime/coverage/Invoker.scala @@ -5,7 +5,6 @@ import scala.annotation.nowarn import scala.collection.concurrent.TrieMap import scala.collection.mutable.{BitSet, HashMap} import java.io.{File, FileWriter} -import java.nio.file.Files @sharable // avoids false positive by -Ycheck-reentrant object Invoker { diff --git a/library/src/scala/util/FromDigits.scala b/library/src/scala/util/FromDigits.scala index cb73782829ff..5afc34c7d0c6 100644 --- a/library/src/scala/util/FromDigits.scala +++ b/library/src/scala/util/FromDigits.scala @@ -1,6 +1,5 @@ package scala.util import scala.math.{BigInt} -import quoted.* import annotation.internal.sharable From ed312813d0c3d118124fcb0f8df507ce9b02ff81 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 16 Jan 2025 10:41:09 -0800 Subject: [PATCH 2/2] Relax check file match with stack trace --- .../test/dotty/tools/vulpix/FileDiff.scala | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/compiler/test/dotty/tools/vulpix/FileDiff.scala b/compiler/test/dotty/tools/vulpix/FileDiff.scala index 80fb2bf43534..8a83302a31d4 100644 --- a/compiler/test/dotty/tools/vulpix/FileDiff.scala +++ b/compiler/test/dotty/tools/vulpix/FileDiff.scala @@ -35,18 +35,21 @@ object FileDiff { else None } - def matches(actual: String, expect: String): Boolean = { - val actual1 = actual.stripLineEnd - val expect1 = expect.stripLineEnd + def matches(actual: String, expect: String): Boolean = + val actual1 = actual.stripLineEnd + val expect1 = expect.stripLineEnd + // handle check file path mismatch on windows + def matchesWindowsPath = File.separatorChar == '\\' && actual1.replace('\\', '/') == expect1 + // obscure line numbers in frames of stack trace output + def obscureFrameLine(s: String): Option[String] = + //at scala.quoted.runtime.impl.QuotesImpl$reflect$ClassDef$.module(QuotesImpl.scala:257) + val frame = """\s+at [^(]+\([^:]+:(\d+)\)""".r + frame.findFirstMatchIn(s).map(m => s"${m.before(1)}_${m.after(1)}") + def matchesStackFrame = + actual1.endsWith(")") && expect1.endsWith(")") && obscureFrameLine(actual1) == obscureFrameLine(expect1) + actual1 == expect1 || matchesStackFrame || matchesWindowsPath - // handle check file path mismatch on windows - actual1 == expect1 || File.separatorChar == '\\' && actual1.replace('\\', '/') == expect1 - } - - def matches(actual: Seq[String], expect: Seq[String]): Boolean = { - actual.length == expect.length - && actual.lazyZip(expect).forall(matches) - } + def matches(actual: Seq[String], expect: Seq[String]): Boolean = actual.corresponds(expect)(matches) def dump(path: String, content: Seq[String]): Unit = { val outFile = dotty.tools.io.File(path)