@@ -69,8 +69,7 @@ object Message:
69
69
* and following recordings get consecutive superscripts starting with 2.
70
70
* @return The possibly superscripted version of `str`.
71
71
*/
72
- def record (str : String , isType : Boolean , entry : Recorded )(using Context ): String =
73
- if ! recordOK then return str
72
+ def record (str : String , isType : Boolean , entry : Recorded )(using Context ): String = if ! recordOK then str else
74
73
// println(s"recording $str, $isType, $entry")
75
74
76
75
/** If `e1` is an alias of another class of the same name, return the other
@@ -125,7 +124,7 @@ object Message:
125
124
}
126
125
127
126
def addendum (cat : String , info : Type ): String = info match {
128
- case bounds @ TypeBounds (lo, hi) if ! (bounds =:= TypeBounds .empty) =>
127
+ case bounds @ TypeBounds (lo, hi) if ! (bounds =:= TypeBounds .empty) && ! bounds.isErroneous =>
129
128
if (lo eq hi) i " which is an alias of $lo"
130
129
else i " with $cat ${boundsStr(bounds)}"
131
130
case _ =>
@@ -155,9 +154,8 @@ object Message:
155
154
def needsExplanation (entry : Recorded ) = entry match {
156
155
case param : TypeParamRef => ctx.typerState.constraint.contains(param)
157
156
case param : ParamRef => false
158
- case skolem : SkolemType => true
159
- case sym : Symbol =>
160
- ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds .empty
157
+ case skolem : SkolemType => true
158
+ case sym : Symbol => ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds .empty
161
159
}
162
160
163
161
val toExplain : List [(String , Recorded )] = seen.toList.flatMap { kvs =>
@@ -170,7 +168,7 @@ object Message:
170
168
(tickedString, alt)
171
169
}
172
170
}
173
- res // help the inferrencer out
171
+ res // help the inferencer out
174
172
}.sortBy(_._1)
175
173
176
174
def columnar (parts : List [(String , String )]): List [String ] = {
@@ -239,11 +237,11 @@ end Message
239
237
*
240
238
* Messages modify the rendendering of interpolated strings in several ways:
241
239
*
242
- * 1. The size of the printed code is limited with a MessafeLimiter . If the message
240
+ * 1. The size of the printed code is limited with a MessageLimiter . If the message
243
241
* would get too large or too deeply nested, a `...` is printed instead.
244
- * 2. References to module classes are prefixed with `object ` for better recogniability .
242
+ * 2. References to module classes are prefixed with `object` for better recognizability .
245
243
* 3. A where clause is sometimes added which contains the following additional explanations:
246
- * - Rerences are disambiguated: If a message contains occurrences of the same identifier
244
+ * - References are disambiguated: If a message contains occurrences of the same identifier
247
245
* representing different symbols, the duplicates are printed with superscripts
248
246
* and the where-clause explains where each symbol is located.
249
247
* - Uninstantiated variables are explained in the where-clause with additional
0 commit comments