@@ -216,17 +216,21 @@ class PrettyType private (
216216 toMods(info),
217217 Name (" " ),
218218 paramss.iterator
219- .map(params => params.symbols.smap(toTermParam))
219+ .map(params => Term . ParamClause ( params.symbols.smap(toTermParam) ))
220220 .toList
221221 )
222222 } else {
223223 Decl .Def (
224224 toMods(info),
225225 Term .Name (info.displayName),
226- tparams.smap(toTypeParam),
227- paramss.iterator
228- .map(params => params.symbols.smap(toTermParam))
229- .toList,
226+ List (
227+ Member .ParamClauseGroup (
228+ tparams.smap(toTypeParam),
229+ paramss.iterator
230+ .map(params => Term .ParamClause (params.symbols.smap(toTermParam)))
231+ .toList,
232+ )
233+ ),
230234 toType(ret)
231235 )
232236 }
@@ -267,7 +271,7 @@ class PrettyType private (
267271 Defn .Trait (
268272 toMods(info),
269273 Type .Name (info.displayName),
270- tparams.smap(toTypeParam),
274+ Type . ParamClause ( tparams.smap(toTypeParam) ),
271275 Ctor .Primary (Nil , Name (" " ), Seq .empty[Term .ParamClause ]),
272276 Template (
273277 Nil ,
@@ -279,7 +283,8 @@ class PrettyType private (
279283 ! i.isVarSetter
280284 ) toStat(i)
281285 else Nil
282- }
286+ },
287+ Nil
283288 )
284289 )
285290 case k.OBJECT =>
@@ -290,7 +295,8 @@ class PrettyType private (
290295 Nil ,
291296 inits,
292297 Self (Name (" " ), None ),
293- objectDecls
298+ objectDecls,
299+ Nil
294300 )
295301 )
296302 case k.PACKAGE_OBJECT =>
@@ -301,35 +307,36 @@ class PrettyType private (
301307 Nil ,
302308 inits,
303309 Self (Name (" " ), None ),
304- objectDecls
310+ objectDecls,
311+ Nil
305312 )
306313 )
307314 case k.CLASS =>
308315 val ctor : Ctor .Primary = declarations
309316 .collectFirst {
310317 case i if i.kind.isConstructor && i.is(p.PRIMARY ) =>
311318 toTree(i) match {
312- case ctor @ Ctor .Primary (_, _, Nil :: Nil )
319+ case ctor @ Ctor .Primary . After_4_6_0 (_, _, Nil :: Nil )
313320 if ! info.is(p.CASE ) =>
314321 // Remove redudant () for non-case classes: class Foo
315322 ctor.copy(paramss = Nil )
316323 case e : Ctor .Primary => e
317324 }
318325 }
319326 .getOrElse {
320- Ctor .Primary (Nil , Name (" " ), Seq .empty[Term .ParamClause ])
327+ Ctor .Primary . After_4_6_0 (Nil , Name (" " ), Seq .empty[Term .ParamClause ])
321328 }
322329
323330 // FIXME: Workaround for https://github.com/scalameta/scalameta/issues/1492
324- val isCtorName = ctor.paramss .flatMap(_.map(_.name.value) ).toSet
331+ val isCtorName = ctor.paramClauses .flatMap(_.values). map(_.name.value).toSet
325332 def isSyntheticMember (m : s.SymbolInformation ): Boolean =
326333 (isCaseClass && isCaseClassMethod(m.displayName)) ||
327334 isCtorName(m.displayName)
328335
329336 Defn .Class (
330337 toMods(info),
331338 Type .Name (info.displayName),
332- tparams.smap(toTypeParam),
339+ Type . ParamClause ( tparams.smap(toTypeParam) ),
333340 ctor,
334341 Template (
335342 Nil ,
@@ -342,7 +349,8 @@ class PrettyType private (
342349 ! isSyntheticMember(i)
343350 ) toStat(i)
344351 else Nil
345- }
352+ },
353+ Nil
346354 )
347355 )
348356 case _ =>
@@ -353,14 +361,14 @@ class PrettyType private (
353361 Defn .Type (
354362 toMods(info),
355363 Type .Name (info.displayName),
356- typeParameters.smap(toTypeParam),
364+ Type . ParamClause ( typeParameters.smap(toTypeParam) ),
357365 toType(lo)
358366 )
359367 } else {
360368 Decl .Type (
361369 toMods(info),
362370 Type .Name (info.displayName),
363- typeParameters.smap(toTypeParam),
371+ Type . ParamClause ( typeParameters.smap(toTypeParam) ),
364372 toTypeBounds(lo, hi)
365373 )
366374 }
@@ -389,7 +397,7 @@ class PrettyType private (
389397 case _ =>
390398 tpe
391399 }
392- Init (
400+ Init . After_4_6_0 (
393401 toType(fixed),
394402 Name .Anonymous (),
395403 // Can't support term arguments
@@ -518,14 +526,14 @@ class PrettyType private (
518526 def targs : List [Type ] =
519527 typeArguments.iterator.map {
520528 case TypeExtractors .Wildcard () =>
521- Type .Placeholder (Type .Bounds (None , None ))
529+ Type .Wildcard (Type .Bounds (None , None ))
522530 case targ =>
523531 toType(targ)
524532 }.toList
525533 symbol match {
526534 case TypeExtractors .FunctionN () if typeArguments.lengthCompare(0 ) > 0 =>
527535 val params :+ res = targs
528- Type .Function (params, res)
536+ Type .Function (Type . FuncParamClause ( params) , res)
529537 case TypeExtractors .TupleN () if typeArguments.lengthCompare(1 ) > 0 =>
530538 Type .Tuple (targs)
531539 case _ =>
@@ -548,7 +556,7 @@ class PrettyType private (
548556 case (name : Type .Name , Seq (lhs, rhs))
549557 if ! Character .isJavaIdentifierPart(name.value.head) =>
550558 Type .ApplyInfix (lhs, name, rhs)
551- case (q, targs) => Type .Apply (q, targs)
559+ case (q, targs) => Type .Apply (q, Type . ArgClause ( targs) )
552560 }
553561 }
554562 case s.SingleType (_, symbol) =>
@@ -634,7 +642,7 @@ class PrettyType private (
634642 Defn .Type (
635643 Nil ,
636644 universalName,
637- typeParameters.smap(toTypeParam),
645+ Type . ParamClause ( typeParameters.smap(toTypeParam) ),
638646 toType(underlying)
639647 ) :: Nil
640648 ),
@@ -681,7 +689,7 @@ class PrettyType private (
681689 Type .Param (
682690 Nil ,
683691 Name (" " ),
684- Nil ,
692+ Type . ParamClause ( Nil ) ,
685693 Type .Bounds (None , None ),
686694 Nil ,
687695 Nil
@@ -698,7 +706,7 @@ class PrettyType private (
698706 Type .Param (
699707 toMods(info),
700708 name = Type .Name (info.displayName),
701- tparams = tparams,
709+ tparamClause = Type . ParamClause ( tparams) ,
702710 tbounds = bounds,
703711 // TODO: re-sugar context and view bounds https://github.com/scalacenter/scalafix/issues/759
704712 vbounds = Nil ,
0 commit comments