fixes #25632; errors incompatibility between {.error.} and {.exportc.} pragmas in semProcAux

This commit is contained in:
ringabout
2026-03-23 17:57:49 +08:00
parent 8bb63b475b
commit 406d687d71

View File

@@ -2552,6 +2552,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
if not hasProto:
implicitPragmas(c, s, n.info, validPragmas)
if sfError in s.flags and sfExportc in s.flags:
localError(c.config, n.info, "{.error.} and {.exportc.} pragmas are incompatible")
if n[pragmasPos].kind != nkEmpty and sfBorrow notin s.flags:
setEffectsForProcType(c.graph, s.typ, n[pragmasPos], s)
s.typ.incl tfEffectSystemWorkaround