From ece714773491de1757d9afbda6d499de9b610b31 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 31 Mar 2021 13:26:44 +0200 Subject: better error messages for .raise effect analysis (#17595) --- compiler/sempass2.nim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'compiler') diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index a1572c85e..87d196fad 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -304,8 +304,8 @@ proc addToIntersection(inter: var TIntersection, s: int) = proc throws(tracked, n, orig: PNode) = if n.typ == nil or n.typ.kind != tyError: if orig != nil: - let x = copyNode(n) - x.info = orig.info + let x = copyTree(orig) + x.typ = n.typ tracked.add x else: tracked.add n @@ -329,7 +329,7 @@ proc createTag(g: ModuleGraph; n: PNode): PNode = if not n.isNil: result.info = n.info proc addRaiseEffect(a: PEffects, e, comesFrom: PNode) = - assert e.kind != nkRaiseStmt + #assert e.kind != nkRaiseStmt var aa = a.exc for i in a.bottom.. 0: rr = rr.lastSon + localError(g.config, r.info, errGenerated, renderTree(rr) & " " & msg & typeToString(r.typ)) popInfoContext(g.config) # hint about unnecessarily listed exception types: if hints: -- cgit 1.4.1-2-gfad0
blob: 0515f028ad0f2a9b2da5c00d5ee10a6df3551c85 (plain) (tree)
1
2
3
4
5
6
7
8
9
10