@@ -142,6 +142,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
142
142
toTextLocal(tp.underlying) ~ " (" ~ toTextRef(tp) ~ " )"
143
143
case tp : TypeRef =>
144
144
toTextPrefix(tp.prefix) ~ selectionString(tp)
145
+ case AppliedType (tycon, args) =>
146
+ (toTextLocal(tycon) ~ " [" ~ Text (args map argText, " , " ) ~ " ]" ).close
145
147
case tp : RefinedType =>
146
148
val parent :: (refined : List [RefinedType @ unchecked]) =
147
149
refinementChain(tp).reverse
@@ -169,12 +171,13 @@ class PlainPrinter(_ctx: Context) extends Printer {
169
171
changePrec(GlobalPrec ) {
170
172
(if (tp.isImplicit) " (implicit " else " (" ) ~
171
173
Text ((tp.paramNames, tp.paramInfos).zipped map paramText, " , " ) ~
172
- " )" ~ toText(tp.resultType)
174
+ (if (tp.resultType.isInstanceOf [MethodType ]) " )" else " ): " ) ~
175
+ toText(tp.resultType)
173
176
}
174
177
case tp : ExprType =>
175
178
changePrec(GlobalPrec ) { " => " ~ toText(tp.resultType) }
176
179
case tp : TypeLambda =>
177
- def paramText (name : Name , bounds : TypeBounds ): Text = name.toString ~ toText(bounds)
180
+ def paramText (name : Name , bounds : TypeBounds ): Text = name.unexpandedName. toString ~ toText(bounds)
178
181
changePrec(GlobalPrec ) {
179
182
" [" ~ Text ((tp.paramNames, tp.paramInfos).zipped.map(paramText), " , " ) ~
180
183
" ]" ~ lambdaHash(tp) ~ (" => " provided ! tp.resultType.isInstanceOf [MethodType ]) ~
@@ -190,13 +193,13 @@ class PlainPrinter(_ctx: Context) extends Printer {
190
193
toTextLocal(tycon) ~ " [" ~ Text (args.map(argText), " , " ) ~ " ]"
191
194
case tp : TypeVar =>
192
195
if (tp.isInstantiated)
193
- toTextLocal(tp.instanceOpt) ~ " ^" // debug for now, so that we can see where the TypeVars are.
196
+ toTextLocal(tp.instanceOpt) ~ ( " ^" provided ctx.settings. YprintDebug .value)
194
197
else {
195
198
val constr = ctx.typerState.constraint
196
199
val bounds =
197
200
if (constr.contains(tp)) constr.fullBounds(tp.origin)(ctx.addMode(Mode .Printing ))
198
201
else TypeBounds .empty
199
- if (bounds.isAlias) toText(bounds.lo) ~ " ^"
202
+ if (bounds.isAlias) toText(bounds.lo) ~ ( " ^" provided ctx.settings. YprintDebug .value)
200
203
else if (ctx.settings.YshowVarBounds .value) " (" ~ toText(tp.origin) ~ " ?" ~ toText(bounds) ~ " )"
201
204
else toText(tp.origin)
202
205
}
0 commit comments