@@ -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) && ! lo.isErroneous && ! hi.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,8 +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 =>
178
+ case skolem : SkolemType => true
179
+ case sym : Symbol =>
181
180
ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds .empty
182
181
}
183
182
@@ -191,7 +190,7 @@ object Message:
191
190
(tickedString, alt)
192
191
}
193
192
}
194
- res // help the inferrencer out
193
+ res // help the inferencer out
195
194
}.sortBy(_._1)
196
195
197
196
def columnar (parts : List [(String , String )]): List [String ] = {
@@ -270,11 +269,11 @@ end Message
270
269
*
271
270
* Messages modify the rendendering of interpolated strings in several ways:
272
271
*
273
- * 1. The size of the printed code is limited with a MessafeLimiter . If the message
272
+ * 1. The size of the printed code is limited with a MessageLimiter . If the message
274
273
* 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 .
274
+ * 2. References to module classes are prefixed with `object` for better recognizability .
276
275
* 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
276
+ * - References are disambiguated: If a message contains occurrences of the same identifier
278
277
* representing different symbols, the duplicates are printed with superscripts
279
278
* and the where-clause explains where each symbol is located.
280
279
* - Uninstantiated variables are explained in the where-clause with additional
0 commit comments