@@ -107,7 +107,7 @@ object Formatting {
107
107
else nonSensicalStartTag + str + nonSensicalEndTag
108
108
}
109
109
110
- private type Recorded = AnyRef /* Symbol | TypeParamRef*/
110
+ private type Recorded = AnyRef /* Symbol | TypeParamRef | SkolemType */
111
111
112
112
private class Seen extends mutable.HashMap [String , List [Recorded ]] {
113
113
@@ -135,8 +135,13 @@ object Formatting {
135
135
if ((sym is ModuleClass ) && sym.sourceModule.exists) simpleNameString(sym.sourceModule)
136
136
else seen.record(super .simpleNameString(sym), sym)
137
137
138
- override def TypeParamRefNameString (param : TypeParamRef ): String =
139
- seen.record(super .TypeParamRefNameString (param), param)
138
+ override def ParamRefNameString (param : ParamRef ): String =
139
+ seen.record(super .ParamRefNameString (param), param)
140
+
141
+ override def toTextRef (tp : SingletonType ): Text = tp match {
142
+ case tp : SkolemType => seen.record(tp.repr, tp)
143
+ case _ => super .toTextRef(tp)
144
+ }
140
145
}
141
146
142
147
/** Create explanation for single `Recorded` type or symbol */
@@ -165,6 +170,8 @@ object Formatting {
165
170
s " is a type variable ${addendum(" constraint" , ctx.typeComparer.bounds(param))}"
166
171
case sym : Symbol =>
167
172
s " is a ${ctx.printer.kindString(sym)}${sym.showExtendedLocation}${addendum(" bounds" , sym.info)}"
173
+ case tp : SkolemType =>
174
+ s " is an unknown value of type ${tp.widen.show}"
168
175
}
169
176
}
170
177
@@ -176,6 +183,7 @@ object Formatting {
176
183
private def explanations (seen : Seen )(implicit ctx : Context ): String = {
177
184
def needsExplanation (entry : Recorded ) = entry match {
178
185
case param : TypeParamRef => ctx.typerState.constraint.contains(param)
186
+ case skolem : SkolemType => true
179
187
case _ => false
180
188
}
181
189
0 commit comments