Skip to content

Commit a54198d

Browse files
Fix "\n " pattern in all error messages
1 parent bdef290 commit a54198d

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
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
@@ -81,7 +81,7 @@ trait SymDenotations { this: Context =>
8181
}
8282
denot match {
8383
case denot: SymDenotation =>
84-
def explainSym(msg: String) = explain(s"$msg\n defined = ${denot.definedPeriodsString}")
84+
def explainSym(msg: String) = explain(s"$msg\ndefined = ${denot.definedPeriodsString}")
8585
if (denot.is(ValidForever) || denot.isRefinementClass) true
8686
else {
8787
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ object Applications {
9595
def fail = {
9696
val addendum =
9797
if (ctx.scala2Mode && unapplyName == nme.unapplySeq)
98-
"\n You might want to try to rewrite the extractor to use `unapply` instead."
98+
"\nYou might want to try to rewrite the extractor to use `unapply` instead."
9999
ctx.error(em"$unapplyResult is not a valid result type of an $unapplyName method of an extractor$addendum", pos)
100100
Nil
101101
}
@@ -778,7 +778,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
778778

779779
/** Overridden in ReTyper to handle primitive operations that can be generated after erasure */
780780
protected def handleUnexpectedFunType(tree: untpd.Apply, fun: Tree)(implicit ctx: Context): Tree =
781-
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}")
781+
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}")
782782

783783
def typedNamedArgs(args: List[untpd.Tree])(implicit ctx: Context) =
784784
for (arg @ NamedArg(id, argtpt) <- args) yield {

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

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

150150
/** A type map which checks that the only cycles in a type are F-bounds
@@ -431,7 +431,7 @@ object Checking {
431431
var tp1 =
432432
if (isLeaked(tp.symbol)) {
433433
errors =
434-
(() => em"non-private $sym refers to private ${tp.symbol}\n in its type signature ${sym.info}") :: errors
434+
(() => em"non-private $sym refers to private ${tp.symbol}\nin its type signature ${sym.info}") :: errors
435435
tp
436436
}
437437
else mapOver(tp)
@@ -620,7 +620,7 @@ trait Checking {
620620
def ofType = if (decl.isType) "" else em": ${other.info}"
621621
def explanation =
622622
if (!decl.isRealMethod) ""
623-
else "\n (the definitions have matching type signatures)"
623+
else "\n(the definitions have matching type signatures)"
624624
ctx.error(em"$decl is already defined as $other$ofType$explanation", decl.pos)
625625
}
626626
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,
@@ -769,7 +769,7 @@ trait Implicits { self: Typer =>
769769
inferImplicit(pt, argument, pos)(ctx.addMode(Mode.OldOverloadingResolution)) match {
770770
case altResult: SearchSuccess =>
771771
ctx.migrationWarning(
772-
s"According to new implicit resolution rules, this will be ambiguous:\n ${result.reason.explanation}",
772+
s"According to new implicit resolution rules, this will be ambiguous:\n${result.reason.explanation}",
773773
pos)
774774
altResult
775775
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

0 commit comments

Comments
 (0)