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

fixes #25642

(cherry picked from commit e25820cf52)
This commit is contained in:
ringabout
2026-03-27 03:38:54 +08:00
committed by narimiran
parent 4d15d918ef
commit 570580662a
2 changed files with 6 additions and 0 deletions

View File

@@ -2167,6 +2167,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)