fixes #8028
This commit is contained in:
parent
0d68ef9f11
commit
dc67dd3bef
1 changed files with 1 additions and 1 deletions
|
|
@ -804,7 +804,7 @@ proc semRaise(c: PContext, n: PNode): PNode =
|
||||||
if not isImportedException(typ, c.config):
|
if not isImportedException(typ, c.config):
|
||||||
if typ.kind != tyRef or typ.lastSon.kind != tyObject:
|
if typ.kind != tyRef or typ.lastSon.kind != tyObject:
|
||||||
localError(c.config, n.info, errExprCannotBeRaised)
|
localError(c.config, n.info, errExprCannotBeRaised)
|
||||||
if not isException(typ.lastSon):
|
if typ.len > 0 and not isException(typ.lastSon):
|
||||||
localError(c.config, n.info, "raised object of type $1 does not inherit from Exception",
|
localError(c.config, n.info, "raised object of type $1 does not inherit from Exception",
|
||||||
[typeToString(typ)])
|
[typeToString(typ)])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue