File tree Expand file tree Collapse file tree 5 files changed +7
-9
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 5 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ object desugar {
117
117
if (local.exists) (defctx.owner.thisType select local).dealiasKeepAnnots
118
118
else {
119
119
def msg =
120
- s " no matching symbol for ${tp.symbol.showLocated} in ${defctx.owner} / ${defctx.effectiveScope.toList}"
120
+ em " no matching symbol for ${tp.symbol.showLocated} in ${defctx.owner} / ${defctx.effectiveScope.toList}"
121
121
ErrorType (msg).assertingErrorsReported(msg)
122
122
}
123
123
case _ =>
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ object Decorators {
287
287
assert(ctx.reporter.errorsReported)
288
288
x
289
289
}
290
- def assertingErrorsReported (msg : => String )(using Context ): T = {
290
+ def assertingErrorsReported (msg : Message )(using Context ): T = {
291
291
assert(ctx.reporter.errorsReported, msg)
292
292
x
293
293
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ object NamerOps:
70
70
def findModuleBuddy (name : Name , scope : Scope )(using Context ) = {
71
71
val it = scope.lookupAll(name).filter(_.is(Module ))
72
72
if (it.hasNext) it.next()
73
- else NoSymbol .assertingErrorsReported(s " no companion $name in $scope" )
73
+ else NoSymbol .assertingErrorsReported(em " no companion $name in $scope" )
74
74
}
75
75
76
76
/** If a class has one of these flags, it does not get a constructor companion */
Original file line number Diff line number Diff line change @@ -5304,8 +5304,6 @@ object Types {
5304
5304
val et = new PreviousErrorType
5305
5305
ctx.base.errorTypeMsg(et) = m
5306
5306
et
5307
- def apply (s : => String )(using Context ): ErrorType =
5308
- apply(s.toMessage)
5309
5307
end ErrorType
5310
5308
5311
5309
class PreviousErrorType extends ErrorType :
Original file line number Diff line number Diff line change @@ -77,10 +77,10 @@ object Splicer {
77
77
ref(defn.Predef_undefined ).withType(ErrorType (ex.msg))
78
78
case NonFatal (ex) =>
79
79
val msg =
80
- s """ Failed to evaluate macro.
81
- | Caused by ${ex.getClass}: ${if (ex.getMessage == null ) " " else ex.getMessage}
82
- | ${ex.getStackTrace.takeWhile(_.getClassName != " dotty.tools.dotc.transform.Splicer$" ).drop(1 ).mkString(" \n " )}
83
- """ .stripMargin
80
+ em """ Failed to evaluate macro.
81
+ | Caused by ${ex.getClass}: ${if (ex.getMessage == null ) " " else ex.getMessage}
82
+ | ${ex.getStackTrace.takeWhile(_.getClassName != " dotty.tools.dotc.transform.Splicer$" ).drop(1 ).mkString(" \n " )}
83
+ """
84
84
report.error(msg, spliceExpansionPos)
85
85
ref(defn.Predef_undefined ).withType(ErrorType (msg))
86
86
}
You can’t perform that action at this time.
0 commit comments