summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2023-10-18 23:16:05 +0200
committerGitHub <noreply@github.com>2023-10-18 23:16:05 +0200
commita42eb0d2bd6dcf3be33e67cbca57f2146d0f863b (patch)
treee496373acc6279f132c5607400c4621c968fda21 /lib
parent294e659ae895c45a8ada51ea5cc0db2e5a004e1d (diff)
downloadspack-a42eb0d2bd6dcf3be33e67cbca57f2146d0f863b.tar.gz
spack-a42eb0d2bd6dcf3be33e67cbca57f2146d0f863b.tar.bz2
spack-a42eb0d2bd6dcf3be33e67cbca57f2146d0f863b.tar.xz
spack-a42eb0d2bd6dcf3be33e67cbca57f2146d0f863b.zip
unparse: also support generic type aliases (#40328)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/util/unparse/unparser.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/spack/spack/util/unparse/unparser.py b/lib/spack/spack/util/unparse/unparser.py
index 932ab8d020..8ca4cd57a3 100644
--- a/lib/spack/spack/util/unparse/unparser.py
+++ b/lib/spack/spack/util/unparse/unparser.py
@@ -1083,6 +1083,10 @@ class Unparser:
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)