Skip to content

Commit a4f9e2d

Browse files
Merge branch 'master' into no-legacy-no-more
2 parents b1a11a5 + e011862 commit a4f9e2d

File tree

2,219 files changed

+425
-1083
lines changed

Some content is hidden

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

2,219 files changed

+425
-1083
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object CheckRealizable {
4040
extends Realizability(i" has conflicting base types $base1 and $base2")
4141

4242
class HasProblemField(fld: SingleDenotation, problem: Realizability)(implicit ctx: Context)
43-
extends Realizability(i" has a member $fld which is not a legal path\n since ${fld.symbol.name}: ${fld.info}${problem.msg}")
43+
extends Realizability(i" has a member $fld which is not a legal path\nsince ${fld.symbol.name}: ${fld.info}${problem.msg}")
4444

4545
class ProblemInUnderlying(tp: Type, problem: Realizability)(implicit ctx: Context)
4646
extends Realizability(i"s underlying type ${tp}${problem.msg}") {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ trait ConstraintHandling {
234234
typr.println(s"approx ${param.show}, from below = $fromBelow, bound = ${bound.show}, inst = ${inst.show}")
235235
inst
236236
case inst =>
237-
assert(inst.exists, i"param = $param\n constraint = $constraint")
237+
assert(inst.exists, i"param = $param\nconstraint = $constraint")
238238
inst
239239
}
240240
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ trait SymDenotations { this: Context =>
8282
}
8383
denot match {
8484
case denot: SymDenotation =>
85-
def explainSym(msg: String) = explain(s"$msg\n defined = ${denot.definedPeriodsString}")
85+
def explainSym(msg: String) = explain(s"$msg\ndefined = ${denot.definedPeriodsString}")
8686
if (denot.is(ValidForever) || denot.isRefinementClass) true
8787
else {
8888
implicit val ctx = this

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ abstract class SymbolLoader extends LazyType {
311311
val msg = ex.getMessage()
312312
ctx.error(
313313
if (msg eq null) "i/o error while loading " + root.name
314-
else "error while loading " + root.name + ",\n " + msg)
314+
else "error while loading " + root.name + ",\n" + msg)
315315
}
316316
try {
317317
val start = currentTime

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
160160
ref(initSymbol).ensureApplied).ensureConforms(tpe)
161161

162162
val methodTree = DefDef(x.symbol.asTerm, methodBody)
163-
ctx.debuglog(s"found a lazy val ${x.show},\n rewrote with ${holderTree.show}")
163+
ctx.debuglog(s"found a lazy val ${x.show},\nrewrote with ${holderTree.show}")
164164
Thicket(holderTree, initTree, methodTree)
165165
}
166166

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ object Applications {
9494
def fail = {
9595
val addendum =
9696
if (ctx.scala2Mode && unapplyName == nme.unapplySeq)
97-
"\n You might want to try to rewrite the extractor to use `unapply` instead."
97+
"\nYou might want to try to rewrite the extractor to use `unapply` instead."
9898
ctx.error(em"$unapplyResult is not a valid result type of an $unapplyName method of an extractor$addendum", pos)
9999
Nil
100100
}
@@ -785,7 +785,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
785785

786786
/** Overridden in ReTyper to handle primitive operations that can be generated after erasure */
787787
protected def handleUnexpectedFunType(tree: untpd.Apply, fun: Tree)(implicit ctx: Context): Tree =
788-
throw new Error(i"unexpected type.\n fun = $fun,\n methPart(fun) = ${methPart(fun)},\n methPart(fun).tpe = ${methPart(fun).tpe},\n tpe = ${fun.tpe}")
788+
throw new Error(i"unexpected type.\n fun = $fun,\n methPart(fun) = ${methPart(fun)},\n methPart(fun).tpe = ${methPart(fun).tpe},\n tpe = ${fun.tpe}")
789789

790790
def typedNamedArgs(args: List[untpd.Tree])(implicit ctx: Context) =
791791
for (arg @ NamedArg(id, argtpt) <- args) yield {
@@ -971,7 +971,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
971971
args.init :+ argSeq
972972
case _ =>
973973
val (regularArgs, varArgs) = args.splitAt(argTypes.length - 1)
974-
regularArgs :+ untpd.SeqLiteral(varArgs, untpd.TypeTree())
974+
regularArgs :+ untpd.SeqLiteral(varArgs, untpd.TypeTree()).withPos(tree.pos)
975975
}
976976
else if (argTypes.lengthCompare(1) == 0 && args.lengthCompare(1) > 0 && ctx.canAutoTuple)
977977
untpd.Tuple(args) :: Nil

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ object Checking {
147147
def checkRealizable(tp: Type, pos: Position)(implicit ctx: Context): Unit = {
148148
val rstatus = realizability(tp)
149149
if (rstatus ne Realizable)
150-
ctx.errorOrMigrationWarning(em"$tp is not a legal path\n since it${rstatus.msg}", pos)
150+
ctx.errorOrMigrationWarning(em"$tp is not a legal path\nsince it${rstatus.msg}", pos)
151151
}
152152

153153
/** A type map which checks that the only cycles in a type are F-bounds
@@ -434,7 +434,7 @@ object Checking {
434434
var tp1 =
435435
if (isLeaked(tp.symbol)) {
436436
errors =
437-
(() => em"non-private $sym refers to private ${tp.symbol}\n in its type signature ${sym.info}") :: errors
437+
(() => em"non-private $sym refers to private ${tp.symbol}\nin its type signature ${sym.info}") :: errors
438438
tp
439439
}
440440
else mapOver(tp)
@@ -623,7 +623,7 @@ trait Checking {
623623
def ofType = if (decl.isType) "" else em": ${other.info}"
624624
def explanation =
625625
if (!decl.isRealMethod) ""
626-
else "\n (the definitions have matching type signatures)"
626+
else "\n(the definitions have matching type signatures)"
627627
ctx.error(em"$decl is already defined as $other$ofType$explanation", decl.pos)
628628
}
629629
if (decl is Synthetic) doubleDefError(other, decl)

compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ object ErrorReporting {
120120
val found1 = dropJavaMethod(found)
121121
val expected1 = dropJavaMethod(expected)
122122
if ((found1 eq found) != (expected eq expected1) && (found1 <:< expected1))
123-
"\n (Note that Scala's and Java's representation of this type differs)"
123+
"\n(Note that Scala's and Java's representation of this type differs)"
124124
else if (found.topType != expected.topType)
125-
"\n (Note that the types are in different universes, see Phantom types)"
125+
"\n(Note that the types are in different universes, see Phantom types)"
126126
else if (ctx.settings.explainTypes.value)
127127
"\n" + ctx.typerState.show + "\n" + TypeComparer.explained((found <:< expected)(_))
128128
else

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ object Implicits {
336336
em"both ${err.refStr(alt1.ref)} and ${err.refStr(alt2.ref)} $qualify"
337337
override def whyNoConversion(implicit ctx: Context) =
338338
"\nNote that implicit conversions cannot be applied because they are ambiguous;" +
339-
"\n " + explanation
339+
"\n" + explanation
340340
}
341341

342342
class MismatchedImplicit(ref: TermRef,
@@ -788,7 +788,7 @@ trait Implicits { self: Typer =>
788788
inferImplicit(pt, argument, pos)(ctx.addMode(Mode.OldOverloadingResolution)) match {
789789
case altResult: SearchSuccess =>
790790
ctx.migrationWarning(
791-
s"According to new implicit resolution rules, this will be ambiguous:\n ${result.reason.explanation}",
791+
s"According to new implicit resolution rules, this will be ambiguous:\n${result.reason.explanation}",
792792
pos)
793793
altResult
794794
case _ =>

compiler/src/dotty/tools/dotc/typer/RefChecks.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ object RefChecks {
177177
.filter(_.name != member.name)
178178
.map(_.show).distinct
179179
if (others1.isEmpty) ""
180-
else i";\n other members with override errors are:: $others1%, %"
180+
else i";\nother members with override errors are:: $others1%, %"
181181
}
182182
ctx.error(msg + othersMsg, clazz.pos)
183183
}
@@ -216,14 +216,14 @@ object RefChecks {
216216
(other.owner isSubClass member.owner) && other.is(Deferred) && !member.is(Deferred)
217217
val addendum =
218218
if (isConcreteOverAbstract)
219-
";\n (Note that %s is abstract,\n and is therefore overridden by concrete %s)".format(
219+
";\n (Note that %s is abstract,\n and is therefore overridden by concrete %s)".format(
220220
infoStringWithLocation(other),
221221
infoStringWithLocation(member))
222222
else if (ctx.settings.Ydebug.value)
223223
err.typeMismatchMsg(memberTp(self), otherTp(self))
224224
else ""
225225

226-
"error overriding %s;\n %s %s%s".format(
226+
"error overriding %s;\n %s %s%s".format(
227227
infoStringWithLocation(other), infoString(member), msg, addendum)
228228
}
229229

compiler/test/dotty/tools/StdLibSources.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ object StdLibSources {
1010
/* For debug only */
1111
private val useExplicitWhiteList = false
1212

13-
private final val stdLibPath = "../scala2-library/src/library/"
13+
private final val stdLibPath = "scala2-library/src/library/"
1414

15-
def blacklistFile: String = "../compiler/test/dotc/scala-collections.blacklist"
16-
private def whitelistFile: String = "../compiler/test/dotc/scala-collections.whitelist"
15+
def blacklistFile: String = "compiler/test/dotc/scala-collections.blacklist"
16+
private def whitelistFile: String = "compiler/test/dotc/scala-collections.whitelist"
1717

1818
def whitelisted: List[String] = {
1919
lazy val whitelistBasedOnBlacklist = all.diff(blacklisted)

0 commit comments

Comments
 (0)