summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r--compiler/semexprs.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 73c778530..544d59491 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -960,9 +960,13 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
 
   var s = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared})
   if s != nil:
-    markUsed(n.sons[1].info, s)
+    if s.kind in OverloadableSyms:
+      result = symChoice(c, n, s, scClosed)
+    else:
+      markUsed(n.sons[1].info, s)
+      result = semSym(c, n, s, flags)
     styleCheckUse(n.sons[1].info, s)
-    return semSym(c, n, s, flags)
+    return
 
   n.sons[0] = semExprWithType(c, n.sons[0], flags+{efDetermineType})
   #restoreOldStyleType(n.sons[0])