Skip to content

Commit dfa8fea

Browse files
committed
Fix problem with printing lambdas.
Previous implementation died because TermRef had no denotation.
1 parent e72ce3d commit dfa8fea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
119119
case TypeLambda(variances, argBoundss, body) =>
120120
val paramNames = variances.indices.toList.map("X" + _)
121121
val instantiate = new TypeMap {
122-
def apply(tp: Type): Type = tp match {
122+
def apply(t: Type): Type = t match {
123123
case TypeRef(RefinedThis(rt), name) if name.isHkArgName && rt.eq(tp) =>
124-
TypeRef(NoPrefix, paramNames(name.hkArgIndex).toTypeName)
125-
case _ => mapOver(tp)
124+
TypeRef.withFixedSym(
125+
NoPrefix, paramNames(name.hkArgIndex).toTypeName, defn.AnyClass)
126+
case _ => mapOver(t)
126127
}
127128
}
128129
return typeLambdaText(paramNames, variances, argBoundss,

0 commit comments

Comments
 (0)