fixes #6965
This commit is contained in:
parent
0b0baece89
commit
f3a895f043
4 changed files with 16 additions and 11 deletions
|
|
@ -445,13 +445,14 @@ proc nextOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym =
|
||||||
|
|
||||||
if result != nil and result.kind == skStub: loadStub(result)
|
if result != nil and result.kind == skStub: loadStub(result)
|
||||||
|
|
||||||
proc pickSym*(c: PContext, n: PNode; kind: TSymKind;
|
proc pickSym*(c: PContext, n: PNode; kinds: set[TSymKind];
|
||||||
flags: TSymFlags = {}): PSym =
|
flags: TSymFlags = {}): PSym =
|
||||||
var o: TOverloadIter
|
var o: TOverloadIter
|
||||||
var a = initOverloadIter(o, c, n)
|
var a = initOverloadIter(o, c, n)
|
||||||
while a != nil:
|
while a != nil:
|
||||||
if a.kind == kind and flags <= a.flags:
|
if a.kind in kinds and flags <= a.flags:
|
||||||
return a
|
if result == nil: result = a
|
||||||
|
else: return nil # ambiguous
|
||||||
a = nextOverloadIter(o, c, n)
|
a = nextOverloadIter(o, c, n)
|
||||||
|
|
||||||
proc isInfixAs*(n: PNode): bool =
|
proc isInfixAs*(n: PNode): bool =
|
||||||
|
|
|
||||||
|
|
@ -320,11 +320,8 @@ proc semTypeIdent(c: PContext, n: PNode): PSym =
|
||||||
if n.kind == nkSym:
|
if n.kind == nkSym:
|
||||||
result = getGenSym(c, n.sym)
|
result = getGenSym(c, n.sym)
|
||||||
else:
|
else:
|
||||||
when defined(nimfix):
|
result = pickSym(c, n, {skType, skGenericParam})
|
||||||
result = pickSym(c, n, skType)
|
if result.isNil:
|
||||||
if result.isNil:
|
|
||||||
result = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared})
|
|
||||||
else:
|
|
||||||
result = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared})
|
result = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared})
|
||||||
if result != nil:
|
if result != nil:
|
||||||
markUsed(n.info, result, c.graph.usageSym)
|
markUsed(n.info, result, c.graph.usageSym)
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
|
|
||||||
proc range*() = echo "yo"
|
proc range*() = echo "yo"
|
||||||
|
|
||||||
|
proc set*(a: int) =
|
||||||
|
discard
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
discard """
|
discard """
|
||||||
errormsg: "ambiguous identifier: 'range' --use system.range or mrange.range"
|
errormsg: "ambiguous identifier: 'range' --use system.range or mrange.range"
|
||||||
line: 9
|
line: 13
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# bug #6726
|
|
||||||
import mrange
|
import mrange
|
||||||
|
|
||||||
|
# bug #6965
|
||||||
|
type SomeObj = object
|
||||||
|
s: set[int8]
|
||||||
|
|
||||||
|
# bug #6726
|
||||||
range()
|
range()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue