(cherry picked from commit 7d32425a57)
This commit is contained in:
Andreas Rumpf
2022-03-26 13:29:04 +01:00
committed by narimiran
parent 2dbceb319c
commit 3a685e863e

View File

@@ -657,7 +657,7 @@ proc pragmaRaisesOrTags(c: PContext, n: PNode) =
x.typ = makeTypeFromExpr(c, x)
else:
var t = skipTypes(c.semTypeNode(c, x, nil), skipPtrs)
if t.kind != tyObject and not t.isMetaType:
if t.kind notin {tyObject, tyOr}:
localError(c.config, x.info, errGenerated, "invalid type for raises/tags list")
x.typ = t