summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-10-16 18:03:01 +0200
committerGitHub <noreply@github.com>2020-10-16 18:03:01 +0200
commit66cd9c2e57de027781a11f4434112ab0e5cfea7b (patch)
tree620698861a6b00680e0b2de1462fac6b76a41968 /compiler
parent6b8baab536d25c744150e0190d2e172165faf92e (diff)
downloadNim-66cd9c2e57de027781a11f4434112ab0e5cfea7b.tar.gz
Fix #15599 (#15601)
* Fix #15599

* Add test
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semmagic.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index 5cd7b28b0..cffd58b92 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -527,7 +527,7 @@ proc magicsAfterOverloadResolution(c: PContext, n: PNode,
     if n[^1].kind == nkSym and n[^1].sym.kind notin {skProc, skFunc}:
       localError(c.config, n.info, "finalizer must be a direct reference to a proc")
     elif optTinyRtti in c.config.globalOptions:
-      let fin = if n[^1].kind == nkLambda: n[^1][namePos].sym
+      let fin = if n[^1].kind in {nkLambda, nkDo}: n[^1][namePos].sym
                 else: n[^1].sym
       # check if we converted this finalizer into a destructor already:
       let t = whereToBindTypeHook(c, fin.typ[1].skipTypes(abstractInst+{tyRef}))