From 8f457f6ebb1d1c446b4ba7bf9db81fc738e774c4 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 29 Jul 2016 23:50:11 +0200 Subject: [PATCH] make tests green again --- compiler/semcall.nim | 13 ++++++++++++- compiler/types.nim | 3 ++- tests/stdlib/nre/find.nim | 4 +++- todo.txt | 3 --- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 87a34ca4a4..c62f53a625 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 42ca0f9fcc..c56382b896 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 diff --git a/tests/stdlib/nre/find.nim b/tests/stdlib/nre/find.nim index 05bfb848a0..94fdd0bc14 100644 --- a/tests/stdlib/nre/find.nim +++ b/tests/stdlib/nre/find.nim @@ -1,4 +1,6 @@ -import unittest, sequtils, nre, optional_nonstrict +import unittest, sequtils +import nre except toSeq +import optional_nonstrict suite "find": test "find text": diff --git a/todo.txt b/todo.txt index 38d0fef58d..86bffcc3df 100644 --- a/todo.txt +++ b/todo.txt @@ -1,9 +1,6 @@ version 1.0 battle plan ======================= -- tests/stdlib/tnre.nim -- tests/closure/tflatmap.nim - - fix "high priority" bugs - try to fix as many compiler crashes as reasonable