From e25820cf523b31b16fca53704d9003a6de1bf099 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 27 Mar 2026 03:38:54 +0800 Subject: [PATCH] fixes #25642; Add support for static type in semTypeNode (#25646) fixes #25642 --- compiler/semtypes.nim | 3 +++ tests/generics/tgeneric0.nim | 3 +++ 2 files changed, 6 insertions(+) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index da7576ca4a..e2f91587ff 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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) diff --git a/tests/generics/tgeneric0.nim b/tests/generics/tgeneric0.nim index 76e9cd8d51..db749a38d3 100644 --- a/tests/generics/tgeneric0.nim +++ b/tests/generics/tgeneric0.nim @@ -219,3 +219,6 @@ block: # bug #19531 x.cb() y.cb() + +block: + proc r(_: typedesc, _: static uint | static int) = discard; r(uint, 0)