Skip to content

Commit 3db347f

Browse files
authored
Merge pull request #6382 from dotty-staging/add-missing-cases-to-the-tasty-printer
Add missing methodic types to the printer
2 parents ea670d9 + 6ff1bb4 commit 3db347f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

library/src/scala/tasty/reflect/Printers.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,6 +1628,27 @@ trait Printers
16281628
case Type.RecursiveThis(_) =>
16291629
this += highlightTypeDef("this", color)
16301630

1631+
case Type.IsMethodType(tpe) =>
1632+
this += "("
1633+
printList(tpe.paramNames.zip(tpe.paramTypes), ", ",
1634+
(x: (String, Type)) => (this += x._1 += ": ").printType(x._2))
1635+
this += ")"
1636+
printType(tpe.resType)
1637+
1638+
case Type.IsPolyType(tpe) =>
1639+
this += "["
1640+
printList(tpe.paramNames.zip(tpe.paramBounds), ", ",
1641+
(x: (String, TypeBounds)) => (this += x._1 += " ").printTypeOrBound(x._2))
1642+
this += "]"
1643+
printType(tpe.resType)
1644+
1645+
case Type.IsTypeLambda(tpe) =>
1646+
this += "["
1647+
printList(tpe.paramNames.zip(tpe.paramBounds), ", ",
1648+
(x: (String, TypeBounds)) => (this += x._1 += " ").printTypeOrBound(x._2))
1649+
this += "] => "
1650+
printType(tpe.resType)
1651+
16311652
case _ =>
16321653
throw new MatchError(tpe.showExtractors)
16331654
}

0 commit comments

Comments
 (0)