diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/lookups.nim | 7 | ||||
-rw-r--r-- | compiler/semtypes.nim | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/compiler/lookups.nim b/compiler/lookups.nim index 65cf504cf..c409acc59 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -445,13 +445,14 @@ proc nextOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym = 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 = var o: TOverloadIter var a = initOverloadIter(o, c, n) while a != nil: - if a.kind == kind and flags <= a.flags: - return a + if a.kind in kinds and flags <= a.flags: + if result == nil: result = a + else: return nil # ambiguous a = nextOverloadIter(o, c, n) proc isInfixAs*(n: PNode): bool = diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index f2fda3453..cb66685b2 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -320,11 +320,8 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = if n.kind == nkSym: result = getGenSym(c, n.sym) else: - when defined(nimfix): - result = pickSym(c, n, skType) - if result.isNil: - result = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared}) - else: + result = pickSym(c, n, {skType, skGenericParam}) + if result.isNil: result = qualifiedLookUp(c, n, {checkAmbiguity, checkUndeclared}) if result != nil: markUsed(n.info, result, c.graph.usageSym) |