Skip to content

Commit ccec3f1

Browse files
committed
Update import wildcard from _ to * in compiler
1 parent 8c602b3 commit ccec3f1

File tree

420 files changed

+3210
-3210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

420 files changed

+3210
-3210
lines changed

compiler/src/dotty/tools/MainGenericRunner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ object MainGenericRunner {
195195

196196
case ExecuteMode.PossibleRun =>
197197
val newClasspath = (settings.classPath :+ ".").flatMap(_.split(classpathSeparator).filter(_.nonEmpty)).map(File(_).toURI.toURL)
198-
import dotty.tools.runner.RichClassLoader._
198+
import dotty.tools.runner.RichClassLoader.*
199199
val newClassLoader = ScalaClassLoader.fromURLsParallelCapable(newClasspath)
200200
val targetToRun = settings.possibleEntryPaths.to(LazyList).find { entryPath =>
201201
newClassLoader.tryToLoadClass(entryPath).orElse {

compiler/src/dotty/tools/backend/jvm/BCodeAsmCommon.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ package jvm
44

55
import scala.language.unsafeNulls
66

7-
import dotty.tools.dotc.core.Flags._
8-
import dotty.tools.dotc.core.Symbols._
7+
import dotty.tools.dotc.core.Flags.*
8+
import dotty.tools.dotc.core.Symbols.*
99
import dotty.tools.dotc.report
1010

1111
/**

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import BCodeHelpers.InvokeStyle
1313

1414
import dotty.tools.dotc.ast.tpd
1515
import dotty.tools.dotc.CompilationUnit
16-
import dotty.tools.dotc.core.Constants._
16+
import dotty.tools.dotc.core.Constants.*
1717
import dotty.tools.dotc.core.Flags.{Label => LabelFlag, _}
18-
import dotty.tools.dotc.core.Types._
18+
import dotty.tools.dotc.core.Types.*
1919
import dotty.tools.dotc.core.StdNames.{nme, str}
20-
import dotty.tools.dotc.core.Symbols._
20+
import dotty.tools.dotc.core.Symbols.*
2121
import dotty.tools.dotc.transform.Erasure
22-
import dotty.tools.dotc.transform.SymUtils._
23-
import dotty.tools.dotc.util.Spans._
24-
import dotty.tools.dotc.core.Contexts._
25-
import dotty.tools.dotc.core.Phases._
22+
import dotty.tools.dotc.transform.SymUtils.*
23+
import dotty.tools.dotc.util.Spans.*
24+
import dotty.tools.dotc.core.Contexts.*
25+
import dotty.tools.dotc.core.Phases.*
2626
import dotty.tools.dotc.core.Decorators.em
2727
import dotty.tools.dotc.report
2828

@@ -33,13 +33,13 @@ import dotty.tools.dotc.report
3333
*
3434
*/
3535
trait BCodeBodyBuilder extends BCodeSkelBuilder {
36-
// import global._
37-
// import definitions._
38-
import tpd._
36+
// import global.*
37+
// import definitions.*
38+
import tpd.*
3939
import int.{_, given}
4040
import DottyBackendInterface.symExtensions
41-
import bTypes._
42-
import coreBTypes._
41+
import bTypes.*
42+
import coreBTypes.*
4343

4444
protected val primitives: DottyPrimitives
4545

@@ -126,7 +126,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
126126
assert(resKind.isNumericType || (resKind == BOOL),
127127
s"$resKind is not a numeric or boolean type [operation: ${fun.symbol}]")
128128

129-
import ScalaPrimitivesOps._
129+
import ScalaPrimitivesOps.*
130130

131131
args match {
132132
// unary operation
@@ -179,7 +179,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
179179
def genArrayOp(tree: Tree, code: Int, expectedType: BType): BType = tree match{
180180

181181
case Apply(DesugaredSelect(arrayObj, _), args) =>
182-
import ScalaPrimitivesOps._
182+
import ScalaPrimitivesOps.*
183183
val k = tpeTK(arrayObj)
184184
genLoad(arrayObj, k)
185185
val elementType = typeOfArrayOp.getOrElse[bTypes.BType](code, abort(s"Unknown operation on arrays: $tree code: $code"))
@@ -262,7 +262,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
262262

263263
val code = primitives.getPrimitive(tree, receiver.tpe)
264264

265-
import ScalaPrimitivesOps._
265+
import ScalaPrimitivesOps.*
266266

267267
if (isArithmeticOp(code)) genArithmeticOp(tree, code)
268268
else if (code == CONCAT) genStringConcat(tree)
@@ -1267,7 +1267,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
12671267

12681268
/* Generate coercion denoted by "code" */
12691269
def genCoercion(code: Int): Unit = {
1270-
import ScalaPrimitivesOps._
1270+
import ScalaPrimitivesOps.*
12711271
(code: @switch) match {
12721272
case B2B | S2S | C2C | I2I | L2L | F2F | D2D => ()
12731273
case _ =>
@@ -1443,7 +1443,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
14431443
val mdescr = bmType.descriptor
14441444

14451445
val isInterface = isEmittedInterface(receiverClass)
1446-
import InvokeStyle._
1446+
import InvokeStyle.*
14471447
if (style == Super) {
14481448
if (isInterface && !method.is(JavaDefined)) {
14491449
val args = new Array[BType](bmType.argumentTypes.length + 1)
@@ -1497,7 +1497,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
14971497
} else if (tk.isRef) { // REFERENCE(_) | ARRAY(_)
14981498
bc.emitIF_ACMP(op, success)
14991499
} else {
1500-
import Primitives._
1500+
import Primitives.*
15011501
def useCmpG = if (negated) op == GT || op == GE else op == LT || op == LE
15021502
(tk: @unchecked) match {
15031503
case LONG => emit(asm.Opcodes.LCMP)
@@ -1512,7 +1512,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
15121512

15131513
/* Emits code to compare (and consume) stack-top and zero using the 'op' operator */
15141514
private def genCZJUMP(success: asm.Label, failure: asm.Label, op: TestOp, tk: BType, targetIfNoJump: asm.Label, negated: Boolean = false): Unit = {
1515-
import Primitives._
1515+
import Primitives.*
15161516
if (targetIfNoJump == success) genCZJUMP(failure, success, op.negate(), tk, targetIfNoJump, negated = !negated)
15171517
else {
15181518
if (tk.isIntSizedType) { // BOOL, BYTE, CHAR, SHORT, or INT

compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ import scala.compiletime.uninitialized
1414
import dotty.tools.dotc.CompilationUnit
1515
import dotty.tools.dotc.ast.tpd
1616
import dotty.tools.dotc.ast.Trees
17-
import dotty.tools.dotc.core.Annotations._
18-
import dotty.tools.dotc.core.Constants._
19-
import dotty.tools.dotc.core.Contexts._
20-
import dotty.tools.dotc.core.Phases._
21-
import dotty.tools.dotc.core.Decorators._
22-
import dotty.tools.dotc.core.Flags._
17+
import dotty.tools.dotc.core.Annotations.*
18+
import dotty.tools.dotc.core.Constants.*
19+
import dotty.tools.dotc.core.Contexts.*
20+
import dotty.tools.dotc.core.Phases.*
21+
import dotty.tools.dotc.core.Decorators.*
22+
import dotty.tools.dotc.core.Flags.*
2323
import dotty.tools.dotc.core.Names.Name
2424
import dotty.tools.dotc.core.NameKinds.ExpandedName
2525
import dotty.tools.dotc.core.Signature
26-
import dotty.tools.dotc.core.StdNames._
26+
import dotty.tools.dotc.core.StdNames.*
2727
import dotty.tools.dotc.core.NameKinds
28-
import dotty.tools.dotc.core.Symbols._
28+
import dotty.tools.dotc.core.Symbols.*
2929
import dotty.tools.dotc.core.Types
30-
import dotty.tools.dotc.core.Types._
30+
import dotty.tools.dotc.core.Types.*
3131
import dotty.tools.dotc.core.TypeErasure
3232
import dotty.tools.dotc.transform.GenericSignatures
3333
import dotty.tools.dotc.transform.ElimErasedValueType
@@ -45,12 +45,12 @@ import dotty.tools.backend.jvm.DottyBackendInterface.symExtensions
4545
*/
4646
trait BCodeHelpers extends BCodeIdiomatic {
4747
// for some reason singleton types aren't allowed in constructor calls. will need several casts in code to enforce
48-
//import global._
49-
import bTypes._
50-
import tpd._
51-
import coreBTypes._
48+
//import global.*
49+
import bTypes.*
50+
import tpd.*
51+
import coreBTypes.*
5252
import int.{_, given}
53-
import DottyBackendInterface._
53+
import DottyBackendInterface.*
5454

5555
// We need to access GenBCode phase to get access to post-processor components.
5656
// At this point it should always be initialized already.
@@ -701,10 +701,10 @@ trait BCodeHelpers extends BCodeIdiomatic {
701701
* classes.
702702
*/
703703
private def typeToTypeKind(tp: Type)(ct: BCodeHelpers)(storage: ct.BCInnerClassGen): ct.bTypes.BType = {
704-
import ct.bTypes._
704+
import ct.bTypes.*
705705
val defn = ctx.definitions
706-
import coreBTypes._
707-
import Types._
706+
import coreBTypes.*
707+
import Types.*
708708
/**
709709
* Primitive types are represented as TypeRefs to the class symbol of, for example, scala.Int.
710710
* The `primitiveTypeMap` maps those class symbols to the corresponding PrimitiveBType.
@@ -852,7 +852,7 @@ trait BCodeHelpers extends BCodeIdiomatic {
852852
object BCodeHelpers {
853853

854854
class InvokeStyle(val style: Int) extends AnyVal {
855-
import InvokeStyle._
855+
import InvokeStyle.*
856856
def isVirtual: Boolean = this == Virtual
857857
def isStatic : Boolean = this == Static
858858
def isSpecial: Boolean = this == Special

compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ trait BCodeIdiomatic {
2222
val bTypes: BTypesFromSymbols[int.type]
2323

2424
import int.{_, given}
25-
import bTypes._
26-
import coreBTypes._
25+
import bTypes.*
26+
import coreBTypes.*
2727

2828

2929
lazy val JavaStringBuilderClassName = jlStringBuilderRef.internalName
@@ -617,7 +617,7 @@ trait BCodeIdiomatic {
617617
/* Constant-valued val-members of JCodeMethodN at the companion object, so as to avoid re-initializing them multiple times. */
618618
object JCodeMethodN {
619619

620-
import asm.Opcodes._
620+
import asm.Opcodes.*
621621

622622
// ---------------- conversions ----------------
623623

@@ -651,7 +651,7 @@ trait BCodeIdiomatic {
651651
* can-multi-thread
652652
*/
653653
final def coercionFrom(code: Int): BType = {
654-
import ScalaPrimitivesOps._
654+
import ScalaPrimitivesOps.*
655655
(code: @switch) match {
656656
case B2B | B2C | B2S | B2I | B2L | B2F | B2D => BYTE
657657
case S2B | S2S | S2C | S2I | S2L | S2F | S2D => SHORT
@@ -668,7 +668,7 @@ trait BCodeIdiomatic {
668668
* can-multi-thread
669669
*/
670670
final def coercionTo(code: Int): BType = {
671-
import ScalaPrimitivesOps._
671+
import ScalaPrimitivesOps.*
672672
(code: @switch) match {
673673
case B2B | C2B | S2B | I2B | L2B | F2B | D2B => BYTE
674674
case B2C | C2C | S2C | I2C | L2C | F2C | D2C => CHAR

compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ import dotty.tools.dotc.transform.SymUtils.*
3131
trait BCodeSkelBuilder extends BCodeHelpers {
3232
import int.{_, given}
3333
import DottyBackendInterface.{symExtensions, _}
34-
import tpd._
35-
import bTypes._
36-
import coreBTypes._
37-
import bCodeAsmCommon._
34+
import tpd.*
35+
import bTypes.*
36+
import coreBTypes.*
37+
import bCodeAsmCommon.*
3838

3939
lazy val NativeAttr: Symbol = requiredClass[scala.native]
4040

compiler/src/dotty/tools/backend/jvm/BCodeSyncAndTry.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import scala.tools.asm
99

1010
import dotty.tools.dotc.CompilationUnit
1111
import dotty.tools.dotc.core.StdNames.nme
12-
import dotty.tools.dotc.core.Symbols._
12+
import dotty.tools.dotc.core.Symbols.*
1313
import dotty.tools.dotc.ast.tpd
1414

1515
/*
@@ -20,9 +20,9 @@ import dotty.tools.dotc.ast.tpd
2020
*/
2121
trait BCodeSyncAndTry extends BCodeBodyBuilder {
2222
import int.given
23-
import tpd._
24-
import bTypes._
25-
import coreBTypes._
23+
import tpd.*
24+
import bTypes.*
25+
import coreBTypes.*
2626
/*
2727
* Functionality to lower `synchronized` and `try` expressions.
2828
*/

compiler/src/dotty/tools/backend/jvm/BTypes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class BTypes { self =>
3939
def classBTypeFromInternalName(internalName: String) = classBTypeFromInternalNameMap(internalName)
4040

4141
val coreBTypes: CoreBTypes { val bTypes: self.type}
42-
import coreBTypes._
42+
import coreBTypes.*
4343

4444
/**
4545
* A BType is either a primitve type, a ClassBType, an ArrayBType of one of these, or a MethodType

compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import scala.annotation.threadUnsafe
77
import scala.collection.mutable
88
import scala.collection.mutable.Clearable
99

10-
import dotty.tools.dotc.core.Flags._
11-
import dotty.tools.dotc.core.Contexts._
12-
import dotty.tools.dotc.core.Phases._
13-
import dotty.tools.dotc.core.Symbols._
10+
import dotty.tools.dotc.core.Flags.*
11+
import dotty.tools.dotc.core.Contexts.*
12+
import dotty.tools.dotc.core.Phases.*
13+
import dotty.tools.dotc.core.Symbols.*
1414
import dotty.tools.dotc.core.Phases.Phase
15-
import dotty.tools.dotc.transform.SymUtils._
15+
import dotty.tools.dotc.transform.SymUtils.*
1616
import dotty.tools.dotc.core.StdNames
1717
import dotty.tools.dotc.core.Phases
1818

@@ -29,12 +29,12 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I, val frontendAcce
2929
lazy val VolatileAttr = requiredClass[scala.volatile]
3030

3131
val bCodeAsmCommon: BCodeAsmCommon[int.type ] = new BCodeAsmCommon(int)
32-
import bCodeAsmCommon._
32+
import bCodeAsmCommon.*
3333

3434
val coreBTypes = new CoreBTypesFromSymbols[I]{
3535
val bTypes: BTypesFromSymbols.this.type = BTypesFromSymbols.this
3636
}
37-
import coreBTypes._
37+
import coreBTypes.*
3838

3939
@threadUnsafe protected lazy val classBTypeFromInternalNameMap =
4040
collection.concurrent.TrieMap.empty[String, ClassBType]
@@ -286,7 +286,7 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I, val frontendAcce
286286

287287
val finalFlag = sym.is(Final) && !toDenot(sym).isClassConstructor && !sym.is(Mutable, butNot = Accessor) && !sym.enclosingClass.is(Trait)
288288

289-
import asm.Opcodes._
289+
import asm.Opcodes.*
290290
import GenBCodeOps.addFlagIf
291291
0 .addFlagIf(privateFlag, ACC_PRIVATE)
292292
.addFlagIf(!privateFlag, ACC_PUBLIC)
@@ -312,7 +312,7 @@ class BTypesFromSymbols[I <: DottyBackendInterface](val int: I, val frontendAcce
312312
}
313313

314314
def javaFieldFlags(sym: Symbol) = {
315-
import asm.Opcodes._
315+
import asm.Opcodes.*
316316
import GenBCodeOps.addFlagIf
317317
javaFlags(sym)
318318
.addFlagIf(sym.hasAnnotation(TransientAttr), ACC_TRANSIENT)

compiler/src/dotty/tools/backend/jvm/BackendUtils.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import scala.tools.asm.Handle
55
import scala.tools.asm.tree.InvokeDynamicInsnNode
66
import asm.tree.ClassNode
77
import scala.collection.mutable
8-
import scala.jdk.CollectionConverters._
8+
import scala.jdk.CollectionConverters.*
99
import dotty.tools.dotc.report
1010

1111
import scala.language.unsafeNulls
@@ -92,9 +92,9 @@ class BackendUtils(val postProcessor: PostProcessor) {
9292
* methods.
9393
*/
9494
def addLambdaDeserialize(classNode: ClassNode, implMethodsArray: Array[Handle]): Unit = {
95-
import asm.Opcodes._
96-
import bTypes._
97-
import coreBTypes._
95+
import asm.Opcodes.*
96+
import bTypes.*
97+
import coreBTypes.*
9898

9999
val cw = classNode
100100

compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import java.io.{DataOutputStream, IOException, BufferedOutputStream, FileOutputS
44
import java.nio.ByteBuffer
55
import java.nio.channels.{ClosedByInterruptException, FileChannel}
66
import java.nio.charset.StandardCharsets.UTF_8
7-
import java.nio.file._
7+
import java.nio.file.*
88
import java.nio.file.attribute.FileAttribute
99
import java.util
1010
import java.util.concurrent.ConcurrentHashMap
@@ -15,7 +15,7 @@ import dotty.tools.dotc.core.Decorators.em
1515
import dotty.tools.io.{AbstractFile, PlainFile}
1616
import dotty.tools.io.PlainFile.toPlainFile
1717
import BTypes.InternalName
18-
import scala.util.chaining._
18+
import scala.util.chaining.*
1919
import dotty.tools.io.JarArchive
2020

2121
import scala.language.unsafeNulls
@@ -146,7 +146,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
146146
val storeOnly = compressionLevel == Deflater.NO_COMPRESSION
147147

148148
val jarWriter: JarOutputStream = {
149-
import scala.util.Properties._
149+
import scala.util.Properties.*
150150
val manifest = new Manifest
151151
val attrs = manifest.getMainAttributes.nn
152152
attrs.put(MANIFEST_VERSION, "1.0")

0 commit comments

Comments
 (0)