From 16c1a90857992df0960f53f5ffa578f14059cee4 Mon Sep 17 00:00:00 2001 From: cooldome Date: Tue, 10 Apr 2018 11:14:59 +0100 Subject: Cpp codegen: handling of imported exceptions. Fixes #3571 (#7360) --- compiler/transf.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/transf.nim') diff --git a/compiler/transf.nim b/compiler/transf.nim index 94899c5d4..e6dc69b38 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -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())` -- cgit 1.4.1-2-gfad0