summary refs log tree commit diff stats
path: root/compiler/parampatterns.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-03-24 10:10:28 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-03-24 10:10:28 +0100
commit299e944cf7777c9ac86ded5aa893d5af9cc08932 (patch)
treeab801e7a11b651d2034a5cf4ad702306b8d3878e /compiler/parampatterns.nim
parent3be4f9111cadd84c77a0b619850092743b154a1e (diff)
downloadNim-299e944cf7777c9ac86ded5aa893d5af9cc08932.tar.gz
fixes the 'var T' checking
Diffstat (limited to 'compiler/parampatterns.nim')
-rw-r--r--compiler/parampatterns.nim7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/parampatterns.nim b/compiler/parampatterns.nim
index 6c37c976a..9ca9f110d 100644
--- a/compiler/parampatterns.nim
+++ b/compiler/parampatterns.nim
@@ -180,14 +180,11 @@ type
 
 proc exprRoot*(n: PNode): PSym =
   var it = n
-  # the sem'check can generate a spurious 'nkHiddenDeref' for some
-  # cases. we skip it here:
-  if it.kind == nkHiddenDeref: it = it[0]
   while true:
     case it.kind
     of nkSym: return it.sym
     of nkDotExpr, nkBracketExpr, nkHiddenAddr,
-       nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr:
+       nkObjUpConv, nkObjDownConv, nkCheckedFieldExpr, nkHiddenDeref:
       it = it[0]
     of nkHiddenStdConv, nkHiddenSubConv, nkConv:
       it = it[1]
@@ -202,7 +199,7 @@ proc exprRoot*(n: PNode): PSym =
       else:
         break
     else:
-      # nkHiddenDeref, nkDerefExpr: assume the 'var T' addresses
+      # nkDerefExpr: assume the 'var T' addresses
       # the heap and so the location is not on the stack.
       break