WIP: as with generics.

This commit is contained in:
Dominik Picheta 2017-02-02 21:36:49 +01:00
commit 656da1f6a9
5 changed files with 21 additions and 10 deletions

View file

@ -286,8 +286,7 @@ proc semTry(c: PContext, n: PNode): PNode =
var typeNode = a.sons[j] # e.g. `Exception`
var symbolNode: PNode = nil # e.g. `foobar`
# Handle the case where the `Exception as foobar` syntax is used.
if typeNode.kind == nkInfix and
considerQuotedIdent(typeNode[0]).s == "as":
if typeNode.isExceptAs():
typeNode = a.sons[j].sons[1]
symbolNode = a.sons[j].sons[2]