diff --git a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala index 5a32363e5fda..e881ad66f09a 100644 --- a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala +++ b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala @@ -12,12 +12,13 @@ import java.util.zip.{CRC32, Deflater, ZipEntry, ZipOutputStream} import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.core.Decorators.em -import dotty.tools.dotc.util.chaining.* import dotty.tools.io.{AbstractFile, PlainFile, VirtualFile} import dotty.tools.io.PlainFile.toPlainFile import BTypes.InternalName import dotty.tools.io.JarArchive +import scala.util.chaining.* + /** !!! This file is now copied in `dotty.tools.io.FileWriters` in a more general way that does not rely upon * `PostProcessorFrontendAccess`, this should probably be changed to wrap that class instead. * diff --git a/compiler/src/dotty/tools/debug/JavaEncoding.scala b/compiler/src/dotty/tools/debug/JavaEncoding.scala index d461c7b0d23c..e220f4e781cf 100644 --- a/compiler/src/dotty/tools/debug/JavaEncoding.scala +++ b/compiler/src/dotty/tools/debug/JavaEncoding.scala @@ -6,7 +6,7 @@ import dotty.tools.dotc.core.Symbols.* import dotty.tools.dotc.core.Flags.* import dotty.tools.dotc.core.Names.* import dotty.tools.backend.jvm.DottyBackendInterface.symExtensions -import dotty.tools.dotc.util.NameTransformer +import scala.reflect.NameTransformer // Inspired by https://github.com/lampepfl/dotty/blob/main/compiler/src/dotty/tools/backend/sjs/JSEncoding.scala private object JavaEncoding: @@ -26,7 +26,7 @@ private object JavaEncoding: else className(sym) def encode(name: TermName)(using Context): String = - NameTransformer.encode(name.toSimpleName).toString + NameTransformer.encode(name.toString) private def binaryName(tpe: Type)(using Context): String = tpe match diff --git a/compiler/src/dotty/tools/dotc/Driver.scala b/compiler/src/dotty/tools/dotc/Driver.scala index f8daabf3ec5d..16743d56c62f 100644 --- a/compiler/src/dotty/tools/dotc/Driver.scala +++ b/compiler/src/dotty/tools/dotc/Driver.scala @@ -10,10 +10,10 @@ import dotty.tools.io.{AbstractFile, FileExtension} import reporting.* import core.Decorators.* import config.Feature -import util.chaining.* +import fromtasty.{TASTYCompiler, TastyFileUtil} import scala.util.control.NonFatal -import fromtasty.{TASTYCompiler, TastyFileUtil} +import scala.util.chaining.* /** Run the Dotty compiler. * diff --git a/compiler/src/dotty/tools/dotc/Run.scala b/compiler/src/dotty/tools/dotc/Run.scala index 58ea3e03edba..5c659101332d 100644 --- a/compiler/src/dotty/tools/dotc/Run.scala +++ b/compiler/src/dotty/tools/dotc/Run.scala @@ -38,7 +38,6 @@ import Run.Progress import scala.compiletime.uninitialized import dotty.tools.dotc.transform.MegaPhase import dotty.tools.dotc.transform.Pickler.AsyncTastyHolder -import dotty.tools.dotc.util.chaining.* import java.util.{Timer, TimerTask} /** A compiler run. Exports various methods to compile source files */ diff --git a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala index 051b4d8f3b5b..c7cef874ef8d 100644 --- a/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala +++ b/compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala @@ -17,7 +17,6 @@ import typer.Checking.{checkBounds, checkAppliedTypesIn} import typer.ErrorReporting.err import typer.ProtoTypes.{LhsProto, WildcardSelectionProto, SelectionProto} import util.{SimpleIdentitySet, EqHashMap, EqHashSet, SrcPos, Property} -import util.chaining.tap import transform.{Recheck, PreRecheck, CapturedVars} import Recheck.* import scala.collection.mutable @@ -32,6 +31,7 @@ import Capabilities.* import Mutability.* import util.common.alwaysTrue import scala.annotation.constructorOnly +import scala.util.chaining.* /** The capture checker */ object CheckCaptures: diff --git a/compiler/src/dotty/tools/dotc/cc/Setup.scala b/compiler/src/dotty/tools/dotc/cc/Setup.scala index 5c8c581f729c..b805339a9e60 100644 --- a/compiler/src/dotty/tools/dotc/cc/Setup.scala +++ b/compiler/src/dotty/tools/dotc/cc/Setup.scala @@ -13,7 +13,6 @@ import ast.tpd, tpd.* import transform.{PreRecheck, Recheck}, Recheck.* import Synthetics.isExcluded import util.SimpleIdentitySet -import util.chaining.* import reporting.Message import printing.{Printer, Texts}, Texts.{Text, Str} import collection.mutable diff --git a/compiler/src/dotty/tools/dotc/config/CliCommand.scala b/compiler/src/dotty/tools/dotc/config/CliCommand.scala index 4c750c613940..cdfa85cef36d 100644 --- a/compiler/src/dotty/tools/dotc/config/CliCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CliCommand.scala @@ -6,8 +6,8 @@ import core.Contexts.* import printing.Highlighting import reporting.NoExplanation -import dotty.tools.dotc.util.chaining.* import scala.PartialFunction.cond +import scala.util.chaining.* trait CliCommand: diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 129a77e7e43f..cd6a218e7ada 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -10,7 +10,7 @@ import dotty.tools.io.{AbstractFile, Directory, PlainDirectory, NoAbstractFile} import Setting.ChoiceWithHelp import ScalaSettingCategories.* -import dotty.tools.dotc.util.chaining.* +import scala.util.chaining.* import java.util.zip.Deflater diff --git a/compiler/src/dotty/tools/dotc/config/Settings.scala b/compiler/src/dotty/tools/dotc/config/Settings.scala index 105ebda16de1..b6ebe8b01eb1 100644 --- a/compiler/src/dotty/tools/dotc/config/Settings.scala +++ b/compiler/src/dotty/tools/dotc/config/Settings.scala @@ -12,7 +12,6 @@ import reflect.ClassTag import scala.util.{Success, Failure} import config.Settings.Setting.ChoiceWithHelp -import util.chaining.* object Settings: diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index f94cebd6a5ec..dbc8e5196b40 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -3,7 +3,6 @@ package dotc package core import scala.io.Codec -import util.NameTransformer import printing.{Showable, Texts, Printer} import Texts.Text import StdNames.str @@ -11,6 +10,7 @@ import config.Config import util.{LinearMap, HashSet} import scala.annotation.internal.sharable +import scala.reflect.NameTransformer object Names { import NameKinds.* @@ -346,10 +346,10 @@ object Names { override def encode: SimpleName = { val dontEncode = this == StdNames.nme.CONSTRUCTOR || this == StdNames.nme.STATIC_CONSTRUCTOR - if (dontEncode) this else NameTransformer.encode(this) + if (dontEncode) this else termName(NameTransformer.encode(this.toString)) } - override def decode: SimpleName = NameTransformer.decode(this) + override def decode: SimpleName = termName(NameTransformer.decode(this.toString)) override def isEmpty: Boolean = length == 0 diff --git a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala index 3aceec2a5b4e..016c89afb7b6 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inlines.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inlines.scala @@ -21,10 +21,11 @@ import staging.StagingLevel import cc.CleanupRetains import collection.mutable +import scala.util.chaining.* + import reporting.{NotConstant, trace} import util.Spans.Span import dotty.tools.dotc.core.Periods.PhaseId -import dotty.tools.dotc.util.chaining.* /** Support for querying inlineable methods and for inlining calls to such methods */ object Inlines: diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 85cdcfed6950..6200091f1f12 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -4,9 +4,12 @@ package parsing import scala.language.unsafeNulls +import scala.annotation.tailrec import scala.annotation.internal.sharable import scala.collection.mutable.ListBuffer import scala.collection.immutable.BitSet +import scala.util.chaining.* + import util.{ SourceFile, SourcePosition, NoSourcePosition } import Tokens.* import Scanners.* @@ -26,7 +29,6 @@ import Symbols.NoSymbol import ScriptParsers.* import Decorators.* import util.Chars -import scala.annotation.tailrec import rewrites.Rewrites.{overlapsPatch, patch, unpatch} import reporting.* import config.Feature @@ -34,7 +36,6 @@ import config.Feature.{sourceVersion, migrateTo3} import config.SourceVersion.* import config.SourceVersion import dotty.tools.dotc.config.MigrationVersion -import dotty.tools.dotc.util.chaining.* import dotty.tools.dotc.config.Feature.ccEnabled object Parsers { diff --git a/compiler/src/dotty/tools/dotc/reporting/Diagnostic.scala b/compiler/src/dotty/tools/dotc/reporting/Diagnostic.scala index a4c30b4658e9..9fb46af2d475 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Diagnostic.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Diagnostic.scala @@ -6,10 +6,11 @@ import dotty.tools.dotc.config.Settings.Setting import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.interfaces.Diagnostic.{ERROR, INFO, WARNING} import dotty.tools.dotc.util.SourcePosition -import dotty.tools.dotc.util.chaining.* +import core.Decorators.toMessage + +import scala.util.chaining.* import java.util.{Collections, Optional, List => JList} -import core.Decorators.toMessage object Diagnostic: diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index 41a586b46b43..cff1aa8eabab 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -27,9 +27,8 @@ import java.io.PrintWriter import ExtractAPI.NonLocalClassSymbolsInCurrentUnits import scala.collection.mutable +import scala.util.chaining.* import scala.util.hashing.MurmurHash3 -import dotty.tools.dotc.util.chaining.* - /** This phase sends a representation of the API of classes to sbt via callbacks. * * This is used by sbt for incremental recompilation. diff --git a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala index 3f156e5a7b40..d60922df8ef8 100644 --- a/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala @@ -11,11 +11,11 @@ import core.Names.Name import core.StdNames.tpnme import collection.mutable +import scala.util.chaining.* import dotty.tools.dotc.{semanticdb => s} import Scala3.{FakeSymbol, SemanticSymbol, WildcardTypeSymbol, TypeParamRefSymbol, TermParamRefSymbol, RefinementSymbol} import dotty.tools.dotc.core.Names.Designator -import dotty.tools.dotc.util.chaining.* class TypeOps: import SymbolScopeOps.* diff --git a/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala b/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala index b48afd24a121..b6ee886e6555 100644 --- a/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala +++ b/compiler/src/dotty/tools/dotc/transform/CheckUnused.scala @@ -20,11 +20,11 @@ import typer.Deriving.OriginalTypeClass import typer.Implicits.{ContextualImplicits, RenamedImplicitRef} import util.{Property, Spans, SrcPos}, Spans.Span import util.Chars.{isLineBreakChar, isWhitespace} -import util.chaining.* import java.util.IdentityHashMap import scala.collection.mutable, mutable.{ArrayBuilder, ListBuffer, Stack} +import scala.util.chaining.* import CheckUnused.* diff --git a/compiler/src/dotty/tools/dotc/transform/Pickler.scala b/compiler/src/dotty/tools/dotc/transform/Pickler.scala index 7aeaeb4e319d..dcc352782644 100644 --- a/compiler/src/dotty/tools/dotc/transform/Pickler.scala +++ b/compiler/src/dotty/tools/dotc/transform/Pickler.scala @@ -28,9 +28,9 @@ import dotty.tools.dotc.transform.Pickler.writeSigFilesAsync import dotty.tools.io.FileWriters.{EagerReporter, BufferingReporter} import dotty.tools.dotc.sbt.interfaces.IncrementalCallback import dotty.tools.dotc.sbt.asyncZincPhasesCompleted -import dotty.tools.dotc.util.chaining.* import scala.concurrent.ExecutionContext import scala.util.control.NonFatal +import scala.util.chaining.* import java.util.concurrent.atomic.AtomicBoolean import java.nio.file.Files diff --git a/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala b/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala index 83ec7fb8399e..dda2d628eb4f 100644 --- a/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/localopt/FormatChecker.scala @@ -3,6 +3,7 @@ package transform.localopt import scala.annotation.tailrec import scala.collection.mutable.ListBuffer +import scala.util.chaining.* import scala.util.matching.Regex.Match import dotty.tools.dotc.ast.tpd.{Match => _, *} @@ -12,7 +13,6 @@ import dotty.tools.dotc.core.Types.* import dotty.tools.dotc.core.Phases.typerPhase import dotty.tools.dotc.reporting.BadFormatInterpolation import dotty.tools.dotc.util.Spans.Span -import dotty.tools.dotc.util.chaining.* /** Formatter string checker. */ class TypedFormatChecker(partsElems: List[Tree], parts: List[String], args: List[Tree])(using Context): diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index b8dbfc3786fe..c7565dabdcd2 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -25,8 +25,6 @@ import reporting.* import Nullables.*, NullOpsDecorator.* import config.{Feature, MigrationVersion, SourceVersion} import util.Property -import util.chaining.tap - import collection.mutable import config.Printers.{overload, typr, unapp} import TypeApplications.* @@ -38,6 +36,7 @@ import annotation.threadUnsafe import scala.annotation.tailrec import scala.util.control.NonFatal +import scala.util.chaining.* import dotty.tools.dotc.cc.isRetains import dotty.tools.dotc.inlines.Inlines diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 80381f42ac1a..b271f5214454 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -31,7 +31,6 @@ import EtaExpansion.etaExpand import TypeComparer.CompareResult import inlines.{Inlines, PrepareInlineable} import util.Spans.* -import util.chaining.* import util.common.* import util.{Property, SimpleIdentityMap, SrcPos} import Applications.{tupleComponentTypes, wrapDefs, defaultArgument} @@ -53,7 +52,7 @@ import config.MigrationVersion import transform.CheckUnused.OriginalName import scala.annotation.{unchecked as _, *} -import dotty.tools.dotc.util.chaining.* +import scala.util.chaining.* import dotty.tools.dotc.ast.untpd.Mod object Typer { diff --git a/compiler/src/dotty/tools/dotc/util/DotClass.scala b/compiler/src/dotty/tools/dotc/util/DotClass.scala deleted file mode 100644 index f9e7e97a219d..000000000000 --- a/compiler/src/dotty/tools/dotc/util/DotClass.scala +++ /dev/null @@ -1,8 +0,0 @@ -package dotty.tools.dotc.util - -/** Adds standard functionality to a class. - * For now: Just the `unsupported` method. - */ -class DotClass { - -} diff --git a/compiler/src/dotty/tools/dotc/util/NameTransformer.scala b/compiler/src/dotty/tools/dotc/util/NameTransformer.scala deleted file mode 100644 index 1d8ef6150e46..000000000000 --- a/compiler/src/dotty/tools/dotc/util/NameTransformer.scala +++ /dev/null @@ -1,150 +0,0 @@ -package dotty.tools -package dotc -package util - - -import core.Names.* - -import scala.annotation.internal.sharable - -/** Provides functions to encode and decode Scala symbolic names. - */ -object NameTransformer { - - private val nops = 128 - private val ncodes = 26 * 26 - - private class OpCodes(val op: Char, val code: String, val next: OpCodes) - - @sharable private val op2code = new Array[String](nops) - @sharable private val code2op = new Array[OpCodes](ncodes) - private def enterOp(op: Char, code: String) = { - op2code(op.toInt) = code - val c = (code.charAt(1) - 'a') * 26 + code.charAt(2) - 'a' - code2op(c.toInt) = new OpCodes(op, code, code2op(c)) - } - - /* Note: decoding assumes opcodes are only ever lowercase. */ - enterOp('~', "$tilde") - enterOp('=', "$eq") - enterOp('<', "$less") - enterOp('>', "$greater") - enterOp('!', "$bang") - enterOp('#', "$hash") - enterOp('%', "$percent") - enterOp('^', "$up") - enterOp('&', "$amp") - enterOp('|', "$bar") - enterOp('*', "$times") - enterOp('/', "$div") - enterOp('+', "$plus") - enterOp('-', "$minus") - enterOp(':', "$colon") - enterOp('\\', "$bslash") - enterOp('?', "$qmark") - enterOp('@', "$at") - - /** Replace operator symbols by corresponding expansion strings, and replace - * characters that are not valid Java identifiers by "$u" followed by the - * character's unicode expansion. - * Note that no attempt is made to escape the use of '$' in `name`: blindly - * escaping them might make it impossible to call some platform APIs. This - * unfortunately means that `decode(encode(name))` might not be equal to - * `name`, this is considered acceptable since '$' is a reserved character in - * the Scala spec as well as the Java spec. - */ - def encode(name: SimpleName): SimpleName = { - var buf: StringBuilder | Null = null - val len = name.length - var i = 0 - while (i < len) { - val c = name(i) - if (c < nops && (op2code(c.toInt) ne null)) { - if (buf eq null) { - buf = new StringBuilder() - buf.append(name.sliceToString(0, i)) - } - buf.append(op2code(c.toInt)) - /* Handle glyphs that are not valid Java/JVM identifiers */ - } - else if (!Character.isJavaIdentifierPart(c)) { - if (buf eq null) { - buf = new StringBuilder() - buf.append(name.sliceToString(0, i)) - } - buf.append("$u%04X".format(c.toInt)) - } - else if (buf ne null) { - buf.append(c) - } - i += 1 - } - if (buf eq null) name else termName(buf.toString) - } - - /** Replace operator expansions by the operators themselves, - * and decode `$u....` expansions into unicode characters. - */ - def decode(name: SimpleName): SimpleName = { - //System.out.println("decode: " + name);//DEBUG - var buf: StringBuilder | Null = null - val len = name.length - var i = 0 - while (i < len) { - var ops: OpCodes | Null = null - var unicode = false - val c = name(i) - if (c == '$' && i + 2 < len) { - val ch1 = name(i + 1) - if ('a' <= ch1 && ch1 <= 'z') { - val ch2 = name(i + 2) - if ('a' <= ch2 && ch2 <= 'z') { - ops = code2op((ch1 - 'a') * 26 + ch2 - 'a') - while ((ops ne null) && !name.startsWith(ops.code, i)) ops = ops.next - if (ops ne null) { - if (buf eq null) { - buf = new StringBuilder() - buf.append(name.sliceToString(0, i)) - } - buf.append(ops.op) - i += ops.code.length() - } - /* Handle the decoding of Unicode glyphs that are - * not valid Java/JVM identifiers */ - } else if ((len - i) >= 6 && // Check that there are enough characters left - ch1 == 'u' && - ((Character.isDigit(ch2)) || - ('A' <= ch2 && ch2 <= 'F'))) { - /* Skip past "$u", next four should be hexadecimal */ - val hex = name.sliceToString(i+2, i+6) - try { - val str = Integer.parseInt(hex, 16).toChar - if (buf eq null) { - buf = new StringBuilder() - buf.append(name.sliceToString(0, i)) - } - buf.append(str) - /* 2 for "$u", 4 for hexadecimal number */ - i += 6 - unicode = true - } catch { - case _:NumberFormatException => - /* `hex` did not decode to a hexadecimal number, so - * do nothing. */ - } - } - } - } - /* If we didn't see an opcode or encoded Unicode glyph, and the - buffer is non-empty, write the current character and advance - one */ - if ((ops eq null) && !unicode) { - if (buf ne null) - buf.append(c) - i += 1 - } - } - //System.out.println("= " + (if (buf == null) name else buf.toString()));//DEBUG - if (buf eq null) name else termName(buf.toString) - } -} diff --git a/compiler/src/dotty/tools/dotc/util/ReusableInstance.scala b/compiler/src/dotty/tools/dotc/util/ReusableInstance.scala index d132940dd03c..d7837d9763fe 100644 --- a/compiler/src/dotty/tools/dotc/util/ReusableInstance.scala +++ b/compiler/src/dotty/tools/dotc/util/ReusableInstance.scala @@ -1,7 +1,7 @@ package dotty.tools.dotc.util import scala.collection.mutable.ArrayBuffer -import dotty.tools.dotc.util.chaining.* +import scala.util.chaining.* /** A wrapper for a list of cached instances of a type `T`. * The wrapper is recursion-reentrant: several instances are kept, so diff --git a/compiler/src/dotty/tools/dotc/util/SourceFile.scala b/compiler/src/dotty/tools/dotc/util/SourceFile.scala index 8800743c4f1c..0340e54ca4b9 100644 --- a/compiler/src/dotty/tools/dotc/util/SourceFile.scala +++ b/compiler/src/dotty/tools/dotc/util/SourceFile.scala @@ -15,7 +15,7 @@ import scala.annotation.internal.sharable import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.compiletime.uninitialized -import dotty.tools.dotc.util.chaining.* +import scala.util.chaining.* import java.io.File.separator import java.net.URI diff --git a/compiler/src/dotty/tools/dotc/util/chaining.scala b/compiler/src/dotty/tools/dotc/util/chaining.scala deleted file mode 100644 index 0c61ab6e73e9..000000000000 --- a/compiler/src/dotty/tools/dotc/util/chaining.scala +++ /dev/null @@ -1,8 +0,0 @@ - -package dotty.tools.dotc.util - -object chaining: - - extension [A](x: A) - inline def tap(inline f: A => Unit): x.type = { f(x): Unit; x } - inline def pipe[B](inline f: A => B): B = f(x) diff --git a/library/src/scala/annotation/unchecked/uncheckedCapabilityLeaks.scala b/library/src/scala/annotation/unchecked/uncheckedCapabilityLeaks.scala deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/repl/src/dotty/tools/repl/ReplCompiler.scala b/repl/src/dotty/tools/repl/ReplCompiler.scala index f600113df35c..c35fc37acbe9 100644 --- a/repl/src/dotty/tools/repl/ReplCompiler.scala +++ b/repl/src/dotty/tools/repl/ReplCompiler.scala @@ -19,11 +19,11 @@ import dotc.typer.TyperPhase import dotc.util.Spans.* import dotc.util.{ParsedComment, Property, SourceFile} import dotc.{CompilationUnit, Compiler, Run} -import dotc.util.chaining.* import results.* import scala.collection.mutable +import scala.util.chaining.* /** This subclass of `Compiler` is adapted for use in the REPL. * diff --git a/repl/src/dotty/tools/repl/StackTraceOps.scala b/repl/src/dotty/tools/repl/StackTraceOps.scala index 618bdd979688..189fc4af092d 100644 --- a/repl/src/dotty/tools/repl/StackTraceOps.scala +++ b/repl/src/dotty/tools/repl/StackTraceOps.scala @@ -14,7 +14,7 @@ package dotty.tools.repl import scala.language.unsafeNulls import collection.mutable, mutable.ListBuffer -import dotty.tools.dotc.util.chaining.* +import scala.util.chaining.* import java.lang.System.lineSeparator object StackTraceOps: