Skip to content

Commit 49b387f

Browse files
Address review
1 parent 35e57f1 commit 49b387f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,12 +763,12 @@ object desugar {
763763
def flagSourcePos(flag: FlagSet) = mods.mods.find(_.flags == flag).fold(mdef.sourcePos)(_.sourcePos)
764764

765765
if (mods.is(Abstract))
766-
ctx.error(hl("Abstract") + " modifier cannot be used for objects", flagSourcePos(Abstract))
766+
ctx.error(em"${hl("abstract")} modifier cannot be used for objects", flagSourcePos(Abstract))
767767
if (mods.is(Sealed))
768-
ctx.error(hl("Sealed") + " modifier is redundant for objects", flagSourcePos(Sealed))
768+
ctx.error(em"${hl("sealed")} modifier is redundant for objects", flagSourcePos(Sealed))
769769
// Maybe this should be an error; see https://github.com/scala/bug/issues/11094.
770770
if (mods.is(Final) && !mods.is(Synthetic))
771-
ctx.warning(hl("Final") + " modifier is redundant for objects", flagSourcePos(Final))
771+
ctx.warning(em"${hl("final")} modifier is redundant for objects", flagSourcePos(Final))
772772

773773
if (mods is Package)
774774
PackageDef(Ident(moduleName), cpy.ModuleDef(mdef)(nme.PACKAGE, impl).withMods(mods &~ Package) :: Nil)

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ object messages {
110110

111111
/** Helper methods for messages */
112112
def implicitClassRestrictionsText(implicit ctx: Context): String =
113-
em"""|${NoColor("For a full list of restrictions on implicit classes visit")}
113+
em"""|For a full list of restrictions on implicit classes visit
114114
|${Blue("http://docs.scala-lang.org/overviews/core/implicit-classes.html")}"""
115115

116116

@@ -726,9 +726,9 @@ object messages {
726726
}
727727

728728
val msg: String =
729-
em"""|${NoColor(msgPrefix)} type arguments for $prettyName$expectedArgString
729+
em"""|$msgPrefix type arguments for $prettyName$expectedArgString
730730
|expected: $expectedArgString
731-
|actual: ${NoColor(actualArgString)}""".stripMargin
731+
|actual: $actualArgString""".stripMargin
732732

733733
val explanation: String = {
734734
val tooManyTypeParams =
@@ -2301,9 +2301,9 @@ object messages {
23012301
// The class or trait that the super-accessor should resolve too in `base`
23022302
val otherMixin = other.owner
23032303
// The super-call in `accMixin`
2304-
val superCall = i"super.$memberName"
2304+
val superCall = hl(i"super.$memberName")
23052305
// The super-call that the super-accesors in `base` forwards to
2306-
val resolvedSuperCall = i"super[${otherMixin.name}].$memberName"
2306+
val resolvedSuperCall = hl(i"super[${otherMixin.name}].$memberName")
23072307
// The super-call that we would have called if `super` in traits behaved like it
23082308
// does in classes, i.e. followed the linearization of the trait itself.
23092309
val staticSuperCall = {
@@ -2315,9 +2315,9 @@ object messages {
23152315
case None => // Might be reachable under separate compilation
23162316
"SomeParent"
23172317
}
2318-
i"super[$staticSuperName].$memberName"
2318+
hl(i"super[$staticSuperName].$memberName")
23192319
}
2320-
em"""$base cannot be defined due to a conflict between its parents when
2320+
ex"""$base cannot be defined due to a conflict between its parents when
23212321
|implementing a super-accessor for $memberName in $accMixin:
23222322
|
23232323
|1. One of its parent (${accMixin.name}) contains a call $superCall in its body,

0 commit comments

Comments
 (0)