Update compiler/semtypes.nim

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ringabout
2026-02-18 21:09:25 +08:00
committed by GitHub
parent d15888d923
commit 9db8d2a75b

View File

@@ -528,7 +528,7 @@ proc semAnonTuple(c: PContext, n: PNode, prev: PType): PType =
result = newOrPrevType(tyTuple, prev, c)
for it in n:
let t = semTypeNode(c, it, nil)
if t != nil and t.kind == tyVoid:
if t != nil and t.skipTypes({tyGenericInst, tyAlias, tySink}).kind == tyVoid:
localError(c.config, it.info, "'void' is not allowed as a field type")
else:
addSonSkipIntLitChecked(c, result, t, it, c.idgen)