This commit is contained in:
Andreas Rumpf 2022-03-26 13:29:04 +01:00 • committed by GitHub
commit 7d32425a57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -656,7 +656,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