@@ -76,8 +76,7 @@ object Message:
76
76
* and following recordings get consecutive superscripts starting with 2.
77
77
* @return The possibly superscripted version of `str`.
78
78
*/
79
- def record (str : String , isType : Boolean , entry : Recorded )(using Context ): String =
80
- if ! recordOK then return str
79
+ def record (str : String , isType : Boolean , entry : Recorded )(using Context ): String = if ! recordOK then str else
81
80
// println(s"recording $str, $isType, $entry")
82
81
83
82
/** If `e1` is an alias of another class of the same name, return the other
@@ -146,7 +145,7 @@ object Message:
146
145
}
147
146
148
147
def addendum (cat : String , info : Type ): String = info match {
149
- case bounds @ TypeBounds (lo, hi) if ! (bounds =:= TypeBounds .empty) =>
148
+ case bounds @ TypeBounds (lo, hi) if ! (bounds =:= TypeBounds .empty) && ! bounds.isErroneous =>
150
149
if (lo eq hi) i " which is an alias of $lo"
151
150
else i " with $cat ${boundsStr(bounds)}"
152
151
case _ =>
@@ -176,9 +175,8 @@ object Message:
176
175
def needsExplanation (entry : Recorded ) = entry match {
177
176
case param : TypeParamRef => ctx.typerState.constraint.contains(param)
178
177
case param : ParamRef => false
179
- case skolem : SkolemType => true
180
- case sym : Symbol =>
181
- ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds .empty
178
+ case skolem : SkolemType => true
179
+ case sym : Symbol => ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds .empty
182
180
}
183
181
184
182
val toExplain : List [(String , Recorded )] = seen.toList.flatMap { kvs =>
@@ -191,7 +189,7 @@ object Message:
191
189
(tickedString, alt)
192
190
}
193
191
}
194
- res // help the inferrencer out
192
+ res // help the inferencer out
195
193
}.sortBy(_._1)
196
194
197
195
def columnar (parts : List [(String , String )]): List [String ] = {
@@ -270,11 +268,11 @@ end Message
270
268
*
271
269
* Messages modify the rendendering of interpolated strings in several ways:
272
270
*
273
- * 1. The size of the printed code is limited with a MessafeLimiter . If the message
271
+ * 1. The size of the printed code is limited with a MessageLimiter . If the message
274
272
* would get too large or too deeply nested, a `...` is printed instead.
275
- * 2. References to module classes are prefixed with `object ` for better recogniability .
273
+ * 2. References to module classes are prefixed with `object` for better recognizability .
276
274
* 3. A where clause is sometimes added which contains the following additional explanations:
277
- * - Rerences are disambiguated: If a message contains occurrences of the same identifier
275
+ * - References are disambiguated: If a message contains occurrences of the same identifier
278
276
* representing different symbols, the duplicates are printed with superscripts
279
277
* and the where-clause explains where each symbol is located.
280
278
* - Uninstantiated variables are explained in the where-clause with additional
0 commit comments