The raises list can now use expressions referencing the generic params
This commit is contained in:
parent
be95f8fdfa
commit
08afa03075
4 changed files with 16 additions and 5 deletions
|
|
@ -637,10 +637,13 @@ proc processPragma(c: PContext, n: PNode, i: int) =
|
|||
|
||||
proc pragmaRaisesOrTags(c: PContext, n: PNode) =
|
||||
proc processExc(c: PContext, x: PNode) =
|
||||
var t = skipTypes(c.semTypeNode(c, x, nil), skipPtrs)
|
||||
if t.kind != tyObject:
|
||||
localError(c.config, x.info, errGenerated, "invalid type for raises/tags list")
|
||||
x.typ = t
|
||||
if c.hasUnresolvedArgs(c, x):
|
||||
x.typ = makeTypeFromExpr(c, x)
|
||||
else:
|
||||
var t = skipTypes(c.semTypeNode(c, x, nil), skipPtrs)
|
||||
if t.kind != tyObject and not t.isMetaType:
|
||||
localError(c.config, x.info, errGenerated, "invalid type for raises/tags list")
|
||||
x.typ = t
|
||||
|
||||
if n.kind in nkPragmaCallKinds and n.len == 2:
|
||||
let it = n[1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue