From d23ae4953510287c64e5bbbfb8c0e1eea23822f6 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 31 Jul 2020 12:13:33 +0200 Subject: fixes #15071 [backport] (#15131) --- compiler/transf.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/transf.nim') diff --git a/compiler/transf.nim b/compiler/transf.nim index 7aa18bf52..29344e7a1 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -1109,15 +1109,15 @@ proc liftDeferAux(n: PNode) = if n[i].kind == nkDefer: let deferPart = newNodeI(nkFinally, n[i].info) deferPart.add n[i][0] - var tryStmt = newNodeI(nkTryStmt, n[i].info) - var body = newNodeI(n.kind, n[i].info) + var tryStmt = newNodeIT(nkTryStmt, n[i].info, n.typ) + var body = newNodeIT(n.kind, n[i].info, n.typ) if i < last: body.sons = n.sons[(i+1)..last] tryStmt.add body tryStmt.add deferPart n[i] = tryStmt n.sons.setLen(i+1) - n.typ = n[i].typ + n.typ = tryStmt.typ goOn = true break for i in 0..n.safeLen-1: -- cgit 1.4.1-2-gfad0