fixes #1657
This commit is contained in:
parent
7edf6fc1d2
commit
b4e38cb498
2 changed files with 15 additions and 2 deletions
|
|
@ -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])
|
||||
|
|
|
|||
9
tests/overload/tsystemcmp.nim
Normal file
9
tests/overload/tsystemcmp.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
cmd: r"nim c --hints:on $options --threads:on $file"
|
||||
"""
|
||||
|
||||
import algorithm
|
||||
|
||||
# bug #1657
|
||||
var modules = @["hi", "ho", "ha", "huu"]
|
||||
sort(modules, system.cmp)
|
||||
Loading…
Add table
Add a link
Reference in a new issue