summary refs log tree commit diff stats
path: root/compiler/semcall.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-11-29 13:31:31 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-11-29 13:31:31 +0100
commit33814cf63e9cdf3300c2d14df8f611dcb863dfaa (patch)
tree229c4485e3cac314aa02cdce4c7badea5de969b7 /compiler/semcall.nim
parent416a322efb3ce8a90c88f596863cbba89d28bccb (diff)
downloadNim-33814cf63e9cdf3300c2d14df8f611dcb863dfaa.tar.gz
language change: change how the experimental dot operators work
Diffstat (limited to 'compiler/semcall.nim')
-rw-r--r--compiler/semcall.nim9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 5c0624a77..5ea34ab1a 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -235,12 +235,11 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
 
     if nfDotField in n.flags:
       internalAssert f.kind == nkIdent and n.sonsLen >= 2
-      let calleeName = newStrNode(nkStrLit, f.ident.s).withInfo(n.info)
 
       # leave the op head symbol empty,
       # we are going to try multiple variants
-      n.sons[0..1] = [nil, n[1], calleeName]
-      orig.sons[0..1] = [nil, orig[1], calleeName]
+      n.sons[0..1] = [nil, n[1], f]
+      orig.sons[0..1] = [nil, orig[1], f]
 
       template tryOp(x) =
         let op = newIdentNode(getIdent(x), n.info)
@@ -255,8 +254,8 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
         tryOp "."
 
     elif nfDotSetter in n.flags and f.kind == nkIdent and n.len == 3:
-      let calleeName = newStrNode(nkStrLit,
-        f.ident.s[0..f.ident.s.len-2]).withInfo(n.info)
+      # we need to strip away the trailing '=' here:
+      let calleeName = newIdentNode(getIdent(f.ident.s[0..f.ident.s.len-2]), n.info)
       let callOp = newIdentNode(getIdent".=", n.info)
       n.sons[0..1] = [callOp, n[1], calleeName]
       orig.sons[0..1] = [callOp, orig[1], calleeName]