unparse: also support generic type aliases (#40328)

This commit is contained in:
Harmen Stoppels 2023-10-18 23:16:05 +02:00 committed by GitHub
parent 294e659ae8
commit a42eb0d2bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1083,6 +1083,10 @@ def visit_MatchOr(self, node):
def visit_TypeAlias(self, node):
self.fill("type ")
self.dispatch(node.name)
if node.type_params:
self.write("[")
interleave(lambda: self.write(", "), self.dispatch, node.type_params)
self.write("]")
self.write(" = ")
self.dispatch(node.value)