Cpp codegen: handling of imported exceptions. Fixes #3571 (#7360)

This commit is contained in:
cooldome 2018-04-10 11:14:59 +01:00 • committed by Andreas Rumpf
commit 16c1a90857
12 changed files with 267 additions and 42 deletions

View file

@ -714,7 +714,7 @@ proc transformCall(c: PTransf, n: PNode): PTransNode =
proc transformExceptBranch(c: PTransf, n: PNode): PTransNode =
result = transformSons(c, n)
if n[0].isInfixAs():
if n[0].isInfixAs() and (not isImportedException(n[0][1].typ)):
let excTypeNode = n[0][1]
let actions = newTransNode(nkStmtListExpr, n[1], 2)
# Generating `let exc = (excType)(getCurrentException())`