fixes #25642; Add support for static type in semTypeNode (#25646)

fixes #25642
This commit is contained in:
ringabout
2026-03-27 03:38:54 +08:00
committed by GitHub
parent 158d59ce48
commit e25820cf52
2 changed files with 6 additions and 0 deletions

View File

@@ -2234,6 +2234,9 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
result = semAnyRef(c, n, tyPtr, prev)
elif op.id == ord(wRef):
result = semAnyRef(c, n, tyRef, prev)
elif op.id == ord(wStatic):
checkSonsLen(n, 2, c.config)
result = semStaticType(c, n[1], prev)
elif op.id == ord(wType):
checkSonsLen(n, 2, c.config)
result = semTypeOf(c, n[1], prev)

View File

@@ -219,3 +219,6 @@ block: # bug #19531
x.cb()
y.cb()
block:
proc r(_: typedesc, _: static uint | static int) = discard; r(uint, 0)