Skip to content

Commit

Permalink
_
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Mar 22, 2020
1 parent 8c5722f commit f9df9e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
6 changes: 1 addition & 5 deletions compiler/semcall.nim
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,7 @@ proc semResolvedCall(c: PContext, x: TCandidate,
markUsed(c, info, finalCallee)
onUse(info, finalCallee)
assert finalCallee.ast != nil
if nfOverloadResolve in n.flags:
# CHECKME: see if handling of `hasFauxMatch` is correct
let info2 = info
return newSymNode(finalCallee, info2)

if nfOverloadResolve in n.flags: return newSymNode(finalCallee, info)
if x.hasFauxMatch:
result = x.call
result[0] = newSymNode(finalCallee, getCallLineInfo(result[0]))
Expand Down
13 changes: 4 additions & 9 deletions compiler/semexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1279,16 +1279,11 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =

var flags2 = {checkAmbiguity, checkUndeclared, checkModule}
var s = qualifiedLookUp(c, n, flags2)

if nfOverloadResolve in n.flags and n.kind == nkDotExpr:
var m = qualifiedLookUp(c, n[0], (flags2*{checkUndeclared})+{checkModule})
if m != nil and m.kind == skModule:
# it's mymodule.someident
if s == nil:
return nil
else:
return symChoice(c, n, s, scClosed)

if m != nil and m.kind == skModule: # got `mymodule.someident`
if s == nil: return nil
else: return symChoice(c, n, s, scClosed)
if s != nil:
if s.kind in OverloadableSyms:
result = symChoice(c, n, s, scClosed)
Expand Down Expand Up @@ -2115,7 +2110,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =

proc semCompiles(c: PContext, n: PNode, flags: TExprFlags): PNode =
# we replace this node by a 'true' or 'false' node:
if n.len != 2: return semDirectOp(c, n, flags) # why needed?
if n.len != 2: return semDirectOp(c, n, flags)
result = newIntNode(nkIntLit, ord(tryExpr(c, n[1], flags) != nil))
result.info = n.info
result.typ = getSysType(c.graph, n.info, tyBool)
Expand Down

0 comments on commit f9df9e1

Please sign in to comment.