Skip to content

Commit 54f5144

Browse files
Address review
1 parent 6b3b9d3 commit 54f5144

20 files changed

+36
-36
lines changed

compiler/src/dotty/tools/dotc/core/TyperState.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class TyperState(previous: TyperState /* | Null */) {
7272
new TyperState(this).setReporter(new StoreReporter(reporter)).setCommittable(isCommittable)
7373

7474
/** The uninstantiated variables */
75-
def uninstVars: Seq[Types.TypeVar] = constraint.uninstVars
75+
def uninstVars: Seq[TypeVar] = constraint.uninstVars
7676

7777
/** The set of uninstantiated type variables which have this state as their owning state */
7878
private[this] var myOwnedVars: TypeVars = SimpleIdentitySet.empty

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,7 +3412,7 @@ object Types {
34123412
abstract case class TermParamRef(binder: TermLambda, paramNum: Int) extends ParamRef with SingletonType {
34133413
type BT = TermLambda
34143414
def kindString: String = "Term"
3415-
def copyBoundType(bt: BT): bt.ParamRefType = bt.paramRefs(paramNum)
3415+
def copyBoundType(bt: BT): Type = bt.paramRefs(paramNum)
34163416
}
34173417

34183418
private final class TermParamRefImpl(binder: TermLambda, paramNum: Int) extends TermParamRef(binder, paramNum)
@@ -3423,7 +3423,7 @@ object Types {
34233423
abstract case class TypeParamRef(binder: TypeLambda, paramNum: Int) extends ParamRef {
34243424
type BT = TypeLambda
34253425
def kindString: String = "Type"
3426-
def copyBoundType(bt: BT): bt.ParamRefType = bt.paramRefs(paramNum)
3426+
def copyBoundType(bt: BT): Type = bt.paramRefs(paramNum)
34273427

34283428
/** Optimized version of occursIn, avoid quadratic blowup when solving
34293429
* constraints over large ground types.
@@ -4875,7 +4875,7 @@ object Types {
48754875

48764876
@sharable var debugTrace: Boolean = false
48774877

4878-
val watchList: List[Names.TypeName] = List[String](
4878+
val watchList: List[TypeName] = List[String](
48794879
) map (_.toTypeName)
48804880

48814881
def isWatched(tp: Type)(implicit ctx: Context): Boolean = tp match {

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ClassfileParser(
6868
protected var pool: ConstantPool = _ // the classfile's constant pool
6969

7070
protected var currentClassName: SimpleName = _ // JVM name of the current class
71-
protected var classTParams: Map[Name, Symbol] = Map[Name, Symbol]()
71+
protected var classTParams: Map[Name, Symbol] = Map()
7272

7373
private[this] var Scala2UnpicklingMode = Mode.Scala2Unpickling
7474

compiler/src/dotty/tools/dotc/core/tasty/PositionUnpickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ package core
44
package tasty
55

66
import util.Positions._
7-
import collection.mutable
7+
import collection.{mutable, Map}
88
import TastyBuffer.Addr
99

1010
/** Unpickler for tree positions */
1111
class PositionUnpickler(reader: TastyReader) {
1212
import reader._
1313

14-
private[tasty] lazy val positions: mutable.HashMap[Addr, Position] = {
14+
private[tasty] lazy val positions: Map[Addr, Position] = {
1515
val positions = new mutable.HashMap[Addr, Position]
1616
var curIndex = 0
1717
var curStart = 0

compiler/src/dotty/tools/dotc/core/tasty/TastyBuffer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ object TastyBuffer {
2222
def relativeTo(base: Addr): Addr = this - base.index - AddrWidth
2323
}
2424

25-
val NoAddr: TastyBuffer.Addr = Addr(-1)
25+
val NoAddr: Addr = Addr(-1)
2626

2727
/** The maximal number of address bytes.
2828
* Since addresses are written as base-128 natural numbers,
@@ -41,7 +41,7 @@ import TastyBuffer._
4141
class TastyBuffer(initialSize: Int) {
4242

4343
/** The current byte array, will be expanded as needed */
44-
var bytes: Array[Byte] = new Array[Byte](initialSize)
44+
var bytes: Array[Byte] = new Array(initialSize)
4545

4646
/** The number of bytes written */
4747
var length: Int = 0
@@ -155,7 +155,7 @@ class TastyBuffer(initialSize: Int) {
155155
}
156156

157157
/** The address (represented as a natural number) at address `at` */
158-
def getAddr(at: Addr): TastyBuffer.Addr = Addr(getNat(at))
158+
def getAddr(at: Addr): Addr = Addr(getNat(at))
159159

160160
/** The smallest address equal to or following `at` which points to a non-zero byte */
161161
final def skipZeroes(at: Addr): Addr =

compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TastyPickler(val rootCls: ClassSymbol) {
1616

1717
val nameBuffer: NameBuffer = new NameBuffer
1818

19-
def newSection(name: String, buf: TastyBuffer): mutable.ArrayBuffer[(NameRef, TastyBuffer)] =
19+
def newSection(name: String, buf: TastyBuffer): Unit =
2020
sections += ((nameBuffer.nameIndex(name.toTermName), buf))
2121

2222
def assembleParts(): Array[Byte] = {

compiler/src/dotty/tools/dotc/core/tasty/TastyReader.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TastyReader(val bytes: Array[Byte], start: Int, end: Int, val base: Int =
2020

2121
private[this] var bp: Int = start
2222

23-
def addr(idx: Int): TastyBuffer.Addr = Addr(idx - base)
23+
def addr(idx: Int): Addr = Addr(idx - base)
2424
def index(addr: Addr): Int = addr.index + base
2525

2626
/** The address of the first byte to read, respectively byte that was read */
@@ -105,10 +105,10 @@ class TastyReader(val bytes: Array[Byte], start: Int, end: Int, val base: Int =
105105
}
106106

107107
/** Read a natural number and return as a NameRef */
108-
def readNameRef(): TastyBuffer.NameRef = NameRef(readNat())
108+
def readNameRef(): NameRef = NameRef(readNat())
109109

110110
/** Read a natural number and return as an address */
111-
def readAddr(): TastyBuffer.Addr = Addr(readNat())
111+
def readAddr(): Addr = Addr(readNat())
112112

113113
/** Read a length number and return the absolute end address implied by it,
114114
* given as <address following length field> + <length-value-read>.

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
243243
}
244244

245245
/** The `decls` scope associated with given symbol */
246-
protected def symScope(sym: Symbol): Scopes.Scope = symScopes.getOrElseUpdate(sym, newScope)
246+
protected def symScope(sym: Symbol): Scope = symScopes.getOrElseUpdate(sym, newScope)
247247

248248
/** Does entry represent an (internal) symbol */
249249
protected def isSymbolEntry(i: Int)(implicit ctx: Context): Boolean = {
@@ -611,7 +611,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
611611
loadTypeParams
612612
}
613613

614-
def rootClassUnpickler(start: Coord, cls: Symbol, module: Symbol, infoRef: Int): ClassUnpickler with SymbolLoaders.SecondCompleter =
614+
def rootClassUnpickler(start: Coord, cls: Symbol, module: Symbol, infoRef: Int): ClassUnpickler =
615615
(new ClassUnpickler(infoRef) with SymbolLoaders.SecondCompleter {
616616
override def startCoord(denot: SymDenotation): Coord = start
617617
}) withDecls symScope(cls) withSourceModule (_ => module)

compiler/src/dotty/tools/dotc/interactive/InteractiveDriver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,6 @@ class InteractiveDriver(val settings: List[String]) extends Driver {
265265
}
266266

267267
object InteractiveDriver {
268-
def toUri(source: SourceFile): java.net.URI = Paths.get(source.file.path).toUri
268+
def toUri(source: SourceFile): URI = Paths.get(source.file.path).toUri
269269
}
270270

compiler/src/dotty/tools/dotc/parsing/JavaScanners.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,5 +534,5 @@ object JavaScanners {
534534
nextToken()
535535
}
536536

537-
val ((lastKeywordStart: Int), (kwArray: Array[Int])) = buildKeywordArray(keywords)
537+
private val ((lastKeywordStart: Int), (kwArray: Array[Int])) = buildKeywordArray(keywords)
538538
}

0 commit comments

Comments
 (0)