@@ -76,8 +76,7 @@ object Message:
7676 * and following recordings get consecutive superscripts starting with 2.
7777 * @return The possibly superscripted version of `str`.
7878 */
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
8180 // println(s"recording $str, $isType, $entry")
8281
8382 /** If `e1` is an alias of another class of the same name, return the other
@@ -146,7 +145,7 @@ object Message:
146145 }
147146
148147 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 =>
150149 if (lo eq hi) i " which is an alias of $lo"
151150 else i " with $cat ${boundsStr(bounds)}"
152151 case _ =>
@@ -176,9 +175,8 @@ object Message:
176175 def needsExplanation (entry : Recorded ) = entry match {
177176 case param : TypeParamRef => ctx.typerState.constraint.contains(param)
178177 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
182180 }
183181
184182 val toExplain : List [(String , Recorded )] = seen.toList.flatMap { kvs =>
@@ -191,7 +189,7 @@ object Message:
191189 (tickedString, alt)
192190 }
193191 }
194- res // help the inferrencer out
192+ res // help the inferencer out
195193 }.sortBy(_._1)
196194
197195 def columnar (parts : List [(String , String )]): List [String ] = {
@@ -270,11 +268,11 @@ end Message
270268 *
271269 * Messages modify the rendendering of interpolated strings in several ways:
272270 *
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
274272 * 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 .
276274 * 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
278276 * representing different symbols, the duplicates are printed with superscripts
279277 * and the where-clause explains where each symbol is located.
280278 * - Uninstantiated variables are explained in the where-clause with additional
0 commit comments