File tree 2 files changed +5
-3
lines changed
compiler/src/dotty/tools/dotc 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ object Decorators {
175
175
* give more info about type variables and to disambiguate where needed.
176
176
*/
177
177
def ex (args : Any * )(implicit ctx : Context ): String =
178
- explained2 (implicit ctx => em(args : _* ))
178
+ explained (implicit ctx => em(args : _* ))
179
179
180
180
/** Formatter that adds syntax highlighting to all interpolated values */
181
181
def hl (args : Any * )(implicit ctx : Context ): String =
Original file line number Diff line number Diff line change @@ -213,9 +213,11 @@ object Formatting {
213
213
* ex"disambiguate $tpe1 and $tpe2"
214
214
* ```
215
215
*/
216
- def explained2 (op : Context => String )(implicit ctx : Context ): String = {
216
+ def explained (op : Context => String )(implicit ctx : Context ): String = {
217
217
val seen = new Seen
218
- op(explainCtx(seen)) ++ explanations(seen)
218
+ val msg = op(explainCtx(seen))
219
+ val addendum = explanations(seen)
220
+ if (addendum.isEmpty) msg else msg ++ " \n\n " ++ addendum
219
221
}
220
222
221
223
/** When getting a type mismatch it is useful to disambiguate placeholders like:
You can’t perform that action at this time.
0 commit comments