Skip to content

Commit 0ad6d90

Browse files
Minor formating changes
1 parent 02e3883 commit 0ad6d90

File tree

9 files changed

+17
-29
lines changed

9 files changed

+17
-29
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ object desugar {
764764
val param = makeSyntheticParameter()
765765
def selector(n: Int) = Select(refOfDef(param), nme.selectorName(n))
766766
val vdefs =
767-
params.zipWithIndex.map{
767+
params.zipWithIndex.map {
768768
case (param, idx) =>
769769
DefDef(param.name, Nil, Nil, TypeTree(), selector(idx)).withPos(param.pos)
770770
}

compiler/src/dotty/tools/dotc/config/CompilerCommand.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
package dotty.tools.dotc
32
package config
43

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ class Definitions {
380380
lazy val ArrayModuleType = ctx.requiredModuleRef("scala.Array")
381381
def ArrayModule(implicit ctx: Context) = ArrayModuleType.symbol.moduleClass.asClass
382382

383-
384383
lazy val UnitType: TypeRef = valueTypeRef("scala.Unit", BoxedUnitType, java.lang.Void.TYPE, UnitEnc)
385384
def UnitClass(implicit ctx: Context) = UnitType.symbol.asClass
386385
lazy val BooleanType = valueTypeRef("scala.Boolean", BoxedBooleanType, java.lang.Boolean.TYPE, BooleanEnc)
@@ -771,7 +770,7 @@ class Definitions {
771770
*/
772771
def erasedFunctionClass(cls: Symbol): Symbol = {
773772
val arity = scalaClassName(cls).functionArity
774-
if (arity > 22) defn.FunctionXXLClass
773+
if (arity > MaxImplementedFunctionArity) defn.FunctionXXLClass
775774
else if (arity >= 0) defn.FunctionClass(arity)
776775
else NoSymbol
777776
}
@@ -785,7 +784,7 @@ class Definitions {
785784
*/
786785
def erasedFunctionType(cls: Symbol): Type = {
787786
val arity = scalaClassName(cls).functionArity
788-
if (arity > 22) defn.FunctionXXLType
787+
if (arity > MaxImplementedFunctionArity) defn.FunctionXXLType
789788
else if (arity >= 0) defn.FunctionType(arity)
790789
else NoType
791790
}
@@ -803,8 +802,8 @@ class Definitions {
803802
)
804803

805804
val PredefImportFns = List[() => TermRef](
806-
() => ScalaPredefModuleRef,
807-
() => DottyPredefModuleRef
805+
() => ScalaPredefModuleRef,
806+
() => DottyPredefModuleRef
808807
)
809808

810809
lazy val RootImportFns =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,4 +1226,4 @@ object Denotations {
12261226
util.Stats.record("stale symbol")
12271227
override def getMessage() = msg
12281228
}
1229-
}
1229+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ object Flags {
237237

238238
final val AccessorOrSealed = Accessor.toCommonFlags
239239

240-
/** A mutable var */
240+
/** A mutable var */
241241
final val Mutable = termFlag(12, "mutable")
242242

243243
/** Symbol is local to current class (i.e. private[this] or protected[this]
@@ -252,7 +252,7 @@ object Flags {
252252
final val TermParamAccessor = ParamAccessor.toTermFlags
253253
final val TypeParamAccessor = ParamAccessor.toTypeFlags
254254

255-
/** A value or class implementing a module */
255+
/** A value or class implementing a module */
256256
final val Module = commonFlag(15, "module")
257257
final val ModuleVal = Module.toTermFlags
258258
final val ModuleClass = Module.toTypeFlags

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
347347
* - For any other uncurried method type (Fs)T, (|Fs|)|T|.
348348
* - For a curried method type (Fs1)(Fs2)T, (|Fs1|,Es2)ET where (Es2)ET = |(Fs2)T|.
349349
* - For a polymorphic type [Ts](Ps)T, |(Ps)T|
350-
* _ For a polymorphic type [Ts]T where T is not a method type, ()|T|
350+
* - For a polymorphic type [Ts]T where T is not a method type, ()|T|
351351
* - For the class info type of java.lang.Object, the same type without any parents.
352352
* - For a class info type of a value class, the same type without any parents.
353353
* - For any other class info type with parents Ps, the same type with

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Erasure extends Phase with DenotTransformer { thisTransformer =>
135135
i"The type $tp - ${tp.toString} of class ${tp.getClass} of tree $tree : ${tree.tpe} / ${tree.getClass} is illegal after erasure, phase = ${ctx.phase.prev}")
136136
}
137137

138-
object Erasure extends TypeTestsCasts{
138+
object Erasure extends TypeTestsCasts {
139139

140140
import tpd._
141141

@@ -344,7 +344,6 @@ object Erasure extends TypeTestsCasts{
344344
* e.m -> e.[]m if `m` is an array operation other than `clone`.
345345
*/
346346
override def typedSelect(tree: untpd.Select, pt: Type)(implicit ctx: Context): Tree = {
347-
348347
def mapOwner(sym: Symbol): Symbol = {
349348
def recur(owner: Symbol): Symbol =
350349
if ((owner eq defn.AnyClass) || (owner eq defn.AnyValClass)) {
@@ -362,14 +361,9 @@ object Erasure extends TypeTestsCasts{
362361
val sym = if (owner eq origSym.owner) origSym else owner.info.decl(origSym.name).symbol
363362
assert(sym.exists, origSym.showLocated)
364363

365-
def select(qual: Tree, sym: Symbol): Tree = {
366-
val name = tree.typeOpt match {
367-
case tp: NamedType if tp.name.is(ShadowedName) => sym.name.derived(ShadowedName)
368-
case _ => sym.name
369-
}
364+
def select(qual: Tree, sym: Symbol): Tree =
370365
untpd.cpy.Select(tree)(qual, sym.name)
371366
.withType(NamedType.withFixedSym(qual.tpe, sym))
372-
}
373367

374368
def selectArrayMember(qual: Tree, erasedPre: Type): Tree =
375369
if (erasedPre isRef defn.ObjectClass)
@@ -447,9 +441,9 @@ object Erasure extends TypeTestsCasts{
447441
}
448442
}
449443

450-
/** Besides normal typing, this method collects all arguments
451-
* to a compacted function into a single argument of array type.
452-
*/
444+
/** Besides normal typing, this method collects all arguments
445+
* to a compacted function into a single argument of array type.
446+
*/
453447
override def typedApply(tree: untpd.Apply, pt: Type)(implicit ctx: Context): Tree = {
454448
val Apply(fun, args) = tree
455449
if (fun.symbol == defn.dummyApply)

compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ import dotty.tools.dotc.util.Positions.Position
3131
import dotty.tools.dotc.core.Decorators._
3232
import dotty.tools.dotc.core.Flags
3333

34-
/** This transform eliminates patterns. Right now it's a dummy.
35-
* Awaiting the real pattern matcher.
36-
* elimRepeated is required
37-
* TODO: outer tests are not generated yet.
38-
*/
34+
/** Translates pattern matching. */
3935
class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
4036
import dotty.tools.dotc.ast.tpd._
4137

@@ -141,7 +137,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
141137

142138
// the force is needed mainly to deal with the GADT typing hack (we can't detect it otherwise as tp nor pt need contain an abstract type, we're just casting wildly)
143139
def _asInstanceOf(b: Symbol, tp: Type): Tree = ref(b).ensureConforms(tp) // andType here breaks t1048
144-
def _isInstanceOf(b: Symbol, tp: Type): Tree = ref(b).select(defn.Any_isInstanceOf).appliedToType(tp)
140+
def _isInstanceOf(b: Symbol, tp: Type): Tree = ref(b).isInstance(tp)
145141
}
146142
}
147143

library/src/dotty/runtime/Arrays.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object Arrays {
1919

2020
/** Convert a sequence to a Java array with element type given by `clazz`. */
2121
def seqToArray[T](xs: Seq[T], clazz: Class[_]): Array[T] = {
22-
val arr = java.lang.reflect.Array.newInstance(clazz, xs.length).asInstanceOf[Array[T]]
22+
val arr = jlr.Array.newInstance(clazz, xs.length).asInstanceOf[Array[T]]
2323
xs.copyToArray(arr)
2424
arr
2525
}

0 commit comments

Comments
 (0)