diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-07-29 23:50:11 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-07-29 23:51:01 +0200 |
commit | 8f457f6ebb1d1c446b4ba7bf9db81fc738e774c4 (patch) | |
tree | d5dc489abd72e30ba2e10eb21435eb489bd97f75 /compiler | |
parent | 60b187513ed8e2a061816a912e372a1c81794d50 (diff) | |
download | Nim-8f457f6ebb1d1c446b4ba7bf9db81fc738e774c4.tar.gz |
make tests green again
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semcall.nim | 13 | ||||
-rw-r--r-- | compiler/types.nim | 3 |
2 files changed, 14 insertions, 2 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 87a34ca4a..c62f53a62 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -53,7 +53,18 @@ proc pickBestCandidate(c: PContext, headSymbol: PNode, if symx.kind in filter: syms.add((symx, o.lastOverloadScope)) symx = nextOverloadIter(o, c, headSymbol) - if syms.len == 0: return + if syms.len == 0: + when false: + if skIterator notin filter: + # also try iterators, but these are 2nd class: + symx = initOverloadIter(o, c, headSymbol) + while symx != nil: + if symx.kind == skIterator: + syms.add((symx, 100)) + symx = nextOverloadIter(o, c, headSymbol) + if syms.len == 0: return + else: + return var z: TCandidate initCandidate(c, best, syms[0][0], initialBinding, symScope) diff --git a/compiler/types.nim b/compiler/types.nim index 42ca0f9fc..c56382b89 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -914,7 +914,8 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool = while a.kind == tyDistinct: a = a.sons[0] if a.kind != b.kind: return false - if x.kind == tyGenericInst: + # this is required by tunique_type but makes no sense really: + if x.kind == tyGenericInst and IgnoreTupleFields notin c.flags: let lhs = x.skipGenericAlias rhs = y.skipGenericAlias |