@@ -142,6 +142,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
142142 toTextLocal(tp.underlying) ~ " (" ~ toTextRef(tp) ~ " )"
143143 case tp : TypeRef =>
144144 toTextPrefix(tp.prefix) ~ selectionString(tp)
145+ case AppliedType (tycon, args) =>
146+ (toTextLocal(tycon) ~ " [" ~ Text (args map argText, " , " ) ~ " ]" ).close
145147 case tp : RefinedType =>
146148 val parent :: (refined : List [RefinedType @ unchecked]) =
147149 refinementChain(tp).reverse
@@ -169,12 +171,13 @@ class PlainPrinter(_ctx: Context) extends Printer {
169171 changePrec(GlobalPrec ) {
170172 (if (tp.isImplicit) " (implicit " else " (" ) ~
171173 Text ((tp.paramNames, tp.paramInfos).zipped map paramText, " , " ) ~
172- " )" ~ toText(tp.resultType)
174+ (if (tp.resultType.isInstanceOf [MethodType ]) " )" else " ): " ) ~
175+ toText(tp.resultType)
173176 }
174177 case tp : ExprType =>
175178 changePrec(GlobalPrec ) { " => " ~ toText(tp.resultType) }
176179 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)
178181 changePrec(GlobalPrec ) {
179182 " [" ~ Text ((tp.paramNames, tp.paramInfos).zipped.map(paramText), " , " ) ~
180183 " ]" ~ lambdaHash(tp) ~ (" => " provided ! tp.resultType.isInstanceOf [MethodType ]) ~
@@ -190,13 +193,13 @@ class PlainPrinter(_ctx: Context) extends Printer {
190193 toTextLocal(tycon) ~ " [" ~ Text (args.map(argText), " , " ) ~ " ]"
191194 case tp : TypeVar =>
192195 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)
194197 else {
195198 val constr = ctx.typerState.constraint
196199 val bounds =
197200 if (constr.contains(tp)) constr.fullBounds(tp.origin)(ctx.addMode(Mode .Printing ))
198201 else TypeBounds .empty
199- if (bounds.isAlias) toText(bounds.lo) ~ " ^"
202+ if (bounds.isAlias) toText(bounds.lo) ~ ( " ^" provided ctx.settings. YprintDebug .value)
200203 else if (ctx.settings.YshowVarBounds .value) " (" ~ toText(tp.origin) ~ " ?" ~ toText(bounds) ~ " )"
201204 else toText(tp.origin)
202205 }
0 commit comments