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:35 +08:00
committed by GitHub
parent 9db8d2a75b
commit 5069d9da7e

View File

@@ -568,7 +568,7 @@ proc semTuple(c: PContext, n: PNode, prev: PType): PType =
else:
localError(c.config, a.info, errTypeExpected)
typ = errorType(c)
if typ != nil and typ.kind == tyVoid:
if typ != nil and skipTypes(typ, {tyGenericInst, tyAlias, tySink}).kind == tyVoid:
localError(c.config, a.info, "'void' is not allowed as a field type")
typ = errorType(c)
for j in 0..<a.len - 2: