Skip to content

Commit 74037f3

Browse files
committed
clean up package declarations and imports
1 parent 5973bf9 commit 74037f3

12 files changed

+83
-94
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@
33
* @author Martin Odersky
44
*/
55

6-
7-
package dotty.tools
8-
package dotc
9-
package backend
10-
package jvm
6+
package dotty.tools.dotc
7+
package backend.jvm
118

129
import scala.collection.{ mutable, immutable }
1310
import scala.annotation.switch
1411

1512
import dotty.tools.asm
1613

17-
import dotc.ast.Trees._
14+
import ast.Trees._
15+
import core.Contexts.Context
1816
import core.Flags
1917
import core.Types.Type
2018
import core.StdNames
@@ -37,7 +35,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder {
3735
* Functionality to build the body of ASM MethodNode, except for `synchronized` and `try` expressions.
3836
*/
3937
abstract class PlainBodyBuilder(cunit: CompilationUnit,
40-
implicit val ctx: dotc.core.Contexts.Context) extends PlainSkelBuilder(cunit) {
38+
implicit val ctx: Context) extends PlainSkelBuilder(cunit) {
4139

4240
import icodes.TestOp
4341
import icodes.opcodes.InvokeStyle

src/dotty/tools/dotc/backend/jvm/BCodeGlue.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
* @author Martin Odersky
44
*/
55

6-
package dotty.tools
7-
package dotc
6+
package dotty.tools.dotc
87
package backend.jvm
98

109
import dotty.tools.asm
1110
import scala.annotation.switch
1211
import scala.collection.{ immutable, mutable }
1312

14-
import dotc.ast.Trees.Tree
15-
import dotc.core.Types.Type
16-
import dotc.core.Symbols.{Symbol, NoSymbol}
13+
import ast.Trees.Tree
14+
import core.Types.Type
15+
import core.Symbols.{Symbol, NoSymbol}
1716

1817
/*
1918
* Immutable representations of bytecode-level types.

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

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
* @author Martin Odersky
44
*/
55

6-
package dotty.tools
7-
package dotc
6+
package dotty.tools.dotc
87
package backend.jvm
98

109
import dotty.tools.asm
1110
import scala.annotation.switch
1211
import scala.collection.{ immutable, mutable }
1312
import dotty.tools.io.AbstractFile
1413

15-
import dotc.ast.Trees._
16-
17-
import dotc.core.StdNames
18-
import dotc.core.Types.Type
19-
import dotc.core.Symbols.{Symbol, NoSymbol}
20-
import dotc.core.SymDenotations._
21-
import dotc.core.Flags
22-
import dotc.core.StdNames.{nme, tpnme}
14+
import ast.Trees._
15+
import core.Contexts.Context
16+
import core.StdNames
17+
import core.Types.Type
18+
import core.Symbols.{Symbol, NoSymbol}
19+
import core.SymDenotations._
20+
import core.Flags
21+
import core.StdNames.{nme, tpnme}
2322

2423
/*
2524
* Traits encapsulating functionality to convert Scala AST Trees into ASM ClassNodes.
@@ -209,7 +208,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
209208
/*
210209
* must-single-thread
211210
*/
212-
def initBytecodeWriter(entryPoints: List[Symbol])(implicit ctx: core.Contexts.Context): BytecodeWriter = {
211+
def initBytecodeWriter(entryPoints: List[Symbol])(implicit ctx: Context): BytecodeWriter = {
213212
settings.outputDirs.getSingleOutput match {
214213
case Some(f) if f hasExtension "jar" =>
215214
// If no main class was specified, see if there's only one
@@ -236,7 +235,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
236235
/*
237236
* must-single-thread
238237
*/
239-
def fieldSymbols(cls: Symbol)(implicit ctx: core.Contexts.Context): List[Symbol] = {
238+
def fieldSymbols(cls: Symbol)(implicit ctx: Context): List[Symbol] = {
240239
for (f <- cls.info.decls.toList ;
241240
if !(f is Flags.Method) && f.isTerm && !(f is Flags.ModuleVal)
242241
) yield f;
@@ -405,14 +404,14 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
405404
*
406405
* must-single-thread
407406
*/
408-
final def internalName(sym: Symbol)(implicit ctx: core.Contexts.Context): String = asmClassType(sym).getInternalName
407+
final def internalName(sym: Symbol)(implicit ctx: Context): String = asmClassType(sym).getInternalName
409408

410409
/*
411410
* Tracks (if needed) the inner class given by `sym`.
412411
*
413412
* must-single-thread
414413
*/
415-
final def asmClassType(sym: Symbol)(implicit ctx: core.Contexts.Context): BType = {
414+
final def asmClassType(sym: Symbol)(implicit ctx: Context): BType = {
416415
assert(
417416
hasInternalName(sym),
418417
{
@@ -441,7 +440,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
441440
*
442441
* TODO(lry): check if `ctx` should be a paramter of the class instead.
443442
*/
444-
final def toTypeKind(t: Type)(implicit ctx: dotc.core.Contexts.Context): BType = {
443+
final def toTypeKind(t: Type)(implicit ctx: Context): BType = {
445444

446445
/* Interfaces have to be handled delicately to avoid introducing spurious errors,
447446
* but if we treat them all as AnyRef we lose too much information.
@@ -535,7 +534,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
535534
/*
536535
* must-single-thread
537536
*/
538-
def asmMethodType(msym: Symbol)(implicit ctx: core.Contexts.Context): BType = {
537+
def asmMethodType(msym: Symbol)(implicit ctx: Context): BType = {
539538
assert(msym is Flags.Method, s"not a method-symbol: $msym")
540539
val resT: BType =
541540
if (msym.isClassConstructor || msym.isConstructor) BType.VOID_TYPE
@@ -550,7 +549,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
550549
*
551550
* must-single-thread
552551
*/
553-
final def trackMemberClasses(csym: Symbol, lateClosuresBTs: List[BType])(implicit ctx: core.Contexts.Context): List[BType] = {
552+
final def trackMemberClasses(csym: Symbol, lateClosuresBTs: List[BType])(implicit ctx: Context): List[BType] = {
554553
val lateInnerClasses = exitingErasure {
555554
for (sym <- List(csym, csym.linkedClassOfClass); memberc <- sym.info.decls.map(innerClassSymbolFor) if memberc.isClass)
556555
yield memberc
@@ -574,14 +573,14 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
574573
*
575574
* must-single-thread
576575
*/
577-
final def descriptor(t: Type)(implicit ctx: core.Contexts.Context): String = (toTypeKind(t).getDescriptor)
576+
final def descriptor(t: Type)(implicit ctx: Context): String = (toTypeKind(t).getDescriptor)
578577

579578
/*
580579
* Tracks (if needed) the inner class given by `sym`.
581580
*
582581
* must-single-thread
583582
*/
584-
final def descriptor(sym: Symbol)(implicit ctx: core.Contexts.Context): String = (asmClassType(sym).getDescriptor)
583+
final def descriptor(sym: Symbol)(implicit ctx: Context): String = (asmClassType(sym).getDescriptor)
585584

586585
} // end of trait BCInnerClassGen
587586

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
* @author Martin Odersky
44
*/
55

6-
package dotty.tools
7-
package dotc
6+
package dotty.tools.dotc
87
package backend.jvm
98

109
import dotty.tools.asm
1110
import scala.annotation.switch
1211
import scala.collection.{ immutable, mutable }
1312
import collection.convert.Wrappers.JListWrapper
1413

15-
import dotc.ast.Trees.Tree
16-
import dotc.core.Types.Type
17-
import dotc.core.Symbols.{Symbol, NoSymbol}
14+
import ast.Trees.Tree
15+
import core.Contexts.Context
16+
import core.Types.Type
17+
import core.Symbols.{Symbol, NoSymbol}
1818

1919
/*
2020
* A high-level facade to the ASM API for bytecode generation.
@@ -692,7 +692,7 @@ abstract class BCodeIdiomatic extends BCodeGlue {
692692
}
693693
}
694694

695-
def abort(msg: => AnyRef)(implicit ctx: core.Contexts.Context): Nothing = {
695+
def abort(msg: => AnyRef)(implicit ctx: Context): Nothing = {
696696
ctx.error(msg)
697697
throw new FatalError(msg)
698698
}

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
* @author Martin Odersky
44
*/
55

6-
7-
package dotty.tools
8-
package dotc
9-
package backend
10-
package jvm
6+
package dotty.tools.dotc
7+
package backend.jvm
118

129
import scala.collection.{ mutable, immutable }
13-
import scala.tools.nsc.symtab._
1410
import scala.annotation.switch
1511

1612
import dotty.tools.asm
1713

18-
import dotc.ast.Trees._
19-
import dotc.core.Types.Type
20-
import dotc.core.Symbols.{Symbol, NoSymbol}
14+
import ast.Trees._
15+
import core.Types.Type
16+
import core.Symbols.{Symbol, NoSymbol}
2117

2218
/*
2319
*

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
* @author Martin Odersky
44
*/
55

6-
7-
package dotty.tools
8-
package dotc
9-
package backend
10-
package jvm
6+
package dotty.tools.dotc
7+
package backend.jvm
118

129
import scala.collection.{ mutable, immutable }
1310
import scala.annotation.switch
1411

1512
import dotty.tools.asm
1613

17-
import dotc.ast.Trees._
18-
import dotc.core.Types.Type
19-
import dotc.core.Symbols.{Symbol, NoSymbol}
14+
import ast.Trees._
15+
import core.Contexts.Context
16+
import core.Types.Type
17+
import core.Symbols.{Symbol, NoSymbol}
2018

2119
/*
2220
*
@@ -30,7 +28,7 @@ abstract class BCodeSyncAndTry extends BCodeBodyBuilder {
3028
* Functionality to lower `synchronized` and `try` expressions.
3129
*/
3230
abstract class SyncAndTryBuilder(cunit: CompilationUnit,
33-
ctx: dotc.core.Contexts.Context) extends PlainBodyBuilder(cunit, ctx) {
31+
ctx: Context) extends PlainBodyBuilder(cunit, ctx) {
3432

3533
import ast.tpd._
3634

src/dotty/tools/dotc/backend/jvm/BCodeTypes.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
* @author Martin Odersky
44
*/
55

6-
package dotty.tools
7-
package dotc
6+
package dotty.tools.dotc
87
package backend.jvm
98

109
import dotty.tools.asm
1110
import scala.collection.{ immutable, mutable }
1211

13-
import dotc.ast.Trees.Tree
14-
import dotc.core.Types.Type
15-
import dotc.core.StdNames
16-
import dotc.core.Symbols.{Symbol, NoSymbol}
17-
import dotc.core.SymDenotations._
18-
import dotc.core.Flags
12+
import ast.Trees.Tree
13+
import core.Contexts.Context
14+
import core.Types.Type
15+
import core.StdNames
16+
import core.Symbols.{Symbol, NoSymbol}
17+
import core.SymDenotations._
18+
import core.Flags
1919

2020
import StdNames.{nme, tpnme}
2121

@@ -78,7 +78,7 @@ abstract class BCodeTypes extends BCodeIdiomatic {
7878
/*
7979
* must-single-thread
8080
*/
81-
def initBCodeTypes(implicit ctx: core.Contexts.Context): Unit = {
81+
def initBCodeTypes(implicit ctx: Context): Unit = {
8282

8383
import core.Symbols.defn
8484

@@ -334,7 +334,7 @@ abstract class BCodeTypes extends BCodeIdiomatic {
334334
final def isDeprecated(sym: Symbol): Boolean = { sym.annotations exists (_ matches definitions.DeprecatedAttr) }
335335

336336
/* must-single-thread */
337-
final def hasInternalName(sym: Symbol)(implicit ctx: core.Contexts.Context) = (
337+
final def hasInternalName(sym: Symbol)(implicit ctx: Context) = (
338338
sym.isClass ||
339339
((sym is Flags.ModuleVal) && !(sym is Flags.Method))
340340
)
@@ -386,7 +386,7 @@ abstract class BCodeTypes extends BCodeIdiomatic {
386386
*
387387
* TODO(lry) check if ctx should be a class parameter
388388
*/
389-
final def exemplar(csym0: Symbol)(implicit ctx: dotc.core.Contexts.Context): Tracked = {
389+
final def exemplar(csym0: Symbol)(implicit ctx: Context): Tracked = {
390390
assert(csym0 != NoSymbol, "NoSymbol can't be tracked")
391391

392392
val csym = {

src/dotty/tools/dotc/backend/jvm/BytecodeWriters.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
* @author Martin Odersky
44
*/
55

6-
package dotty.tools
7-
package dotc
6+
package dotty.tools.dotc
87
package backend.jvm
98

9+
import scala.language.postfixOps
10+
1011
import java.io.{ DataOutputStream, FileOutputStream, IOException, OutputStream, File => JFile }
11-
import scala.tools.nsc.io._
1212
import java.util.jar.Attributes.Name
13-
import scala.language.postfixOps
13+
14+
import dotty.tools.io._
1415

1516
/** Can't output a file due to the state of the file system. */
1617
class FileConflictException(msg: String, val file: AbstractFile) extends IOException(msg)

0 commit comments

Comments
 (0)