@@ -216,17 +216,25 @@ class PrettyType private (
216216 toMods(info),
217217 Name (" " ),
218218 paramss.iterator
219- .map(params => params.symbols.smap(toTermParam))
219+ .map(params =>
220+ Term .ParamClause (params.symbols.smap(toTermParam))
221+ )
220222 .toList
221223 )
222224 } else {
223225 Decl .Def (
224226 toMods(info),
225227 Term .Name (info.displayName),
226- tparams.smap(toTypeParam),
227- paramss.iterator
228- .map(params => params.symbols.smap(toTermParam))
229- .toList,
228+ List (
229+ Member .ParamClauseGroup (
230+ tparams.smap(toTypeParam),
231+ paramss.iterator
232+ .map(params =>
233+ Term .ParamClause (params.symbols.smap(toTermParam))
234+ )
235+ .toList
236+ )
237+ ),
230238 toType(ret)
231239 )
232240 }
@@ -267,7 +275,7 @@ class PrettyType private (
267275 Defn .Trait (
268276 toMods(info),
269277 Type .Name (info.displayName),
270- tparams.smap(toTypeParam),
278+ Type . ParamClause ( tparams.smap(toTypeParam) ),
271279 Ctor .Primary (Nil , Name (" " ), Seq .empty[Term .ParamClause ]),
272280 Template (
273281 Nil ,
@@ -279,7 +287,8 @@ class PrettyType private (
279287 ! i.isVarSetter
280288 ) toStat(i)
281289 else Nil
282- }
290+ },
291+ Nil
283292 )
284293 )
285294 case k.OBJECT =>
@@ -290,7 +299,8 @@ class PrettyType private (
290299 Nil ,
291300 inits,
292301 Self (Name (" " ), None ),
293- objectDecls
302+ objectDecls,
303+ Nil
294304 )
295305 )
296306 case k.PACKAGE_OBJECT =>
@@ -301,35 +311,44 @@ class PrettyType private (
301311 Nil ,
302312 inits,
303313 Self (Name (" " ), None ),
304- objectDecls
314+ objectDecls,
315+ Nil
305316 )
306317 )
307318 case k.CLASS =>
308319 val ctor : Ctor .Primary = declarations
309320 .collectFirst {
310321 case i if i.kind.isConstructor && i.is(p.PRIMARY ) =>
311322 toTree(i) match {
312- case ctor @ Ctor .Primary (_, _, Nil :: Nil )
313- if ! info.is(p.CASE ) =>
323+ case ctor @ Ctor .Primary .After_4_6_0 (
324+ _,
325+ _,
326+ Term .ParamClause (Nil , _) :: Nil
327+ ) if ! info.is(p.CASE ) =>
314328 // Remove redudant () for non-case classes: class Foo
315329 ctor.copy(paramss = Nil )
316330 case e : Ctor .Primary => e
317331 }
318332 }
319333 .getOrElse {
320- Ctor .Primary (Nil , Name (" " ), Seq .empty[Term .ParamClause ])
334+ Ctor .Primary .After_4_6_0 (
335+ Nil ,
336+ Name (" " ),
337+ Seq .empty[Term .ParamClause ]
338+ )
321339 }
322340
323341 // FIXME: Workaround for https://github.com/scalameta/scalameta/issues/1492
324- val isCtorName = ctor.paramss.flatMap(_.map(_.name.value)).toSet
342+ val isCtorName =
343+ ctor.paramClauses.flatMap(_.values).map(_.name.value).toSet
325344 def isSyntheticMember (m : s.SymbolInformation ): Boolean =
326345 (isCaseClass && isCaseClassMethod(m.displayName)) ||
327346 isCtorName(m.displayName)
328347
329348 Defn .Class (
330349 toMods(info),
331350 Type .Name (info.displayName),
332- tparams.smap(toTypeParam),
351+ Type . ParamClause ( tparams.smap(toTypeParam) ),
333352 ctor,
334353 Template (
335354 Nil ,
@@ -342,7 +361,8 @@ class PrettyType private (
342361 ! isSyntheticMember(i)
343362 ) toStat(i)
344363 else Nil
345- }
364+ },
365+ Nil
346366 )
347367 )
348368 case _ =>
@@ -353,14 +373,14 @@ class PrettyType private (
353373 Defn .Type (
354374 toMods(info),
355375 Type .Name (info.displayName),
356- typeParameters.smap(toTypeParam),
376+ Type . ParamClause ( typeParameters.smap(toTypeParam) ),
357377 toType(lo)
358378 )
359379 } else {
360380 Decl .Type (
361381 toMods(info),
362382 Type .Name (info.displayName),
363- typeParameters.smap(toTypeParam),
383+ Type . ParamClause ( typeParameters.smap(toTypeParam) ),
364384 toTypeBounds(lo, hi)
365385 )
366386 }
@@ -389,7 +409,7 @@ class PrettyType private (
389409 case _ =>
390410 tpe
391411 }
392- Init (
412+ Init . After_4_6_0 (
393413 toType(fixed),
394414 Name .Anonymous (),
395415 // Can't support term arguments
@@ -518,14 +538,14 @@ class PrettyType private (
518538 def targs : List [Type ] =
519539 typeArguments.iterator.map {
520540 case TypeExtractors .Wildcard () =>
521- Type .Placeholder (Type .Bounds (None , None ))
541+ Type .Wildcard (Type .Bounds (None , None ))
522542 case targ =>
523543 toType(targ)
524544 }.toList
525545 symbol match {
526546 case TypeExtractors .FunctionN () if typeArguments.lengthCompare(0 ) > 0 =>
527547 val params :+ res = targs
528- Type .Function (params, res)
548+ Type .Function (Type . FuncParamClause ( params) , res)
529549 case TypeExtractors .TupleN () if typeArguments.lengthCompare(1 ) > 0 =>
530550 Type .Tuple (targs)
531551 case _ =>
@@ -548,7 +568,7 @@ class PrettyType private (
548568 case (name : Type .Name , Seq (lhs, rhs))
549569 if ! Character .isJavaIdentifierPart(name.value.head) =>
550570 Type .ApplyInfix (lhs, name, rhs)
551- case (q, targs) => Type .Apply (q, targs)
571+ case (q, targs) => Type .Apply (q, Type . ArgClause ( targs) )
552572 }
553573 }
554574 case s.SingleType (_, symbol) =>
@@ -634,7 +654,7 @@ class PrettyType private (
634654 Defn .Type (
635655 Nil ,
636656 universalName,
637- typeParameters.smap(toTypeParam),
657+ Type . ParamClause ( typeParameters.smap(toTypeParam) ),
638658 toType(underlying)
639659 ) :: Nil
640660 ),
@@ -681,7 +701,7 @@ class PrettyType private (
681701 Type .Param (
682702 Nil ,
683703 Name (" " ),
684- Nil ,
704+ Type . ParamClause ( Nil ) ,
685705 Type .Bounds (None , None ),
686706 Nil ,
687707 Nil
@@ -698,7 +718,7 @@ class PrettyType private (
698718 Type .Param (
699719 toMods(info),
700720 name = Type .Name (info.displayName),
701- tparams = tparams,
721+ tparamClause = Type . ParamClause ( tparams) ,
702722 tbounds = bounds,
703723 // TODO: re-sugar context and view bounds https://github.com/scalacenter/scalafix/issues/759
704724 vbounds = Nil ,
0 commit comments