From 13e612c11bd9e06c57713b9e82d7bfb74f4348db Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 28 Aug 2015 00:51:31 -0500 Subject: [PATCH] Fix tests. --- artiq/compiler/types.py | 8 ++++---- lit-test/test/inferencer/builtin_calls.py | 8 ++++---- lit-test/test/inferencer/class.py | 4 ++-- lit-test/test/inferencer/error_method.py | 2 +- lit-test/test/inferencer/unify.py | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/artiq/compiler/types.py b/artiq/compiler/types.py index d4cb47aef..32501d961 100644 --- a/artiq/compiler/types.py +++ b/artiq/compiler/types.py @@ -521,10 +521,10 @@ class TypePrinter(object): self.map[typ] = "'%s" % next(self.gen) return self.map[typ] elif isinstance(typ, TInstance): - if typ.name in self.recurse_guard: + if typ in self.recurse_guard: return "".format(typ.name) else: - self.recurse_guard.add(typ.name) + self.recurse_guard.add(typ) attrs = ", ".join(["{}: {}".format(attr, self.name(typ.attributes[attr])) for attr in typ.attributes]) return "".format(typ.name, attrs) @@ -554,10 +554,10 @@ class TypePrinter(object): elif isinstance(typ, TBuiltinFunction): return "".format(typ.name) elif isinstance(typ, (TConstructor, TExceptionConstructor)): - if typ.name in self.recurse_guard: + if typ in self.recurse_guard: return "".format(typ.name) else: - self.recurse_guard.add(typ.name) + self.recurse_guard.add(typ) attrs = ", ".join(["{}: {}".format(attr, self.name(typ.attributes[attr])) for attr in typ.attributes]) return "".format(typ.name, attrs) diff --git a/lit-test/test/inferencer/builtin_calls.py b/lit-test/test/inferencer/builtin_calls.py index 1ba629fba..61a97fb4a 100644 --- a/lit-test/test/inferencer/builtin_calls.py +++ b/lit-test/test/inferencer/builtin_calls.py @@ -4,22 +4,22 @@ # CHECK-L: bool:():bool bool() -# CHECK-L: bool:([]:list(elt='a)):bool +# CHECK-L: bool:([]:list(elt='a)):bool bool([]) # CHECK-L: int:():int(width='b) int() -# CHECK-L: int:(1.0:float):int(width='c) +# CHECK-L: int:(1.0:float):int(width='c) int(1.0) -# CHECK-L: int:(1.0:float, width=64:int(width='d)):int(width=64) +# CHECK-L: int:(1.0:float, width=64:int(width='d)):int(width=64) int(1.0, width=64) # CHECK-L: float:():float float() -# CHECK-L: float:(1:int(width='e)):float +# CHECK-L: float:(1:int(width='e)):float float(1) # CHECK-L: list:():list(elt='f) diff --git a/lit-test/test/inferencer/class.py b/lit-test/test/inferencer/class.py index 455f3e810..db8ddd27c 100644 --- a/lit-test/test/inferencer/class.py +++ b/lit-test/test/inferencer/class.py @@ -8,12 +8,12 @@ class c: def m(self): pass -# CHECK-L: c:NoneType, m: (self:)->NoneType}> c # CHECK-L: .a:int(width='a) c.a # CHECK-L: .f:()->NoneType c.f -# CHECK-L: .m:method(fn=(self:c)->NoneType, self=c) +# CHECK-L: .m:method(fn=(self:)->NoneType, self=) c().m() diff --git a/lit-test/test/inferencer/error_method.py b/lit-test/test/inferencer/error_method.py index bf9b1fbe8..bf9f87b86 100644 --- a/lit-test/test/inferencer/error_method.py +++ b/lit-test/test/inferencer/error_method.py @@ -12,5 +12,5 @@ class c: c().f() c.g(1) -# CHECK-L: ${LINE:+1}: error: cannot unify c with int(width='a) while inferring the type for self argument +# CHECK-L: ${LINE:+1}: error: cannot unify with int(width='a) while inferring the type for self argument c().g() diff --git a/lit-test/test/inferencer/unify.py b/lit-test/test/inferencer/unify.py index 31679beb6..59d23e937 100644 --- a/lit-test/test/inferencer/unify.py +++ b/lit-test/test/inferencer/unify.py @@ -61,13 +61,13 @@ IndexError() # CHECK-L: IndexError:():IndexError IndexError("x") -# CHECK-L: IndexError:("x":str):IndexError +# CHECK-L: IndexError:("x":str):IndexError IndexError("x", 1) -# CHECK-L: IndexError:("x":str, 1:int(width=64)):IndexError +# CHECK-L: IndexError:("x":str, 1:int(width=64)):IndexError IndexError("x", 1, 1) -# CHECK-L: IndexError:("x":str, 1:int(width=64), 1:int(width=64)):IndexError +# CHECK-L: IndexError:("x":str, 1:int(width=64), 1:int(width=64)):IndexError IndexError("x", 1, 1, 1) -# CHECK-L: IndexError:("x":str, 1:int(width=64), 1:int(width=64), 1:int(width=64)):IndexError +# CHECK-L: IndexError:("x":str, 1:int(width=64), 1:int(width=64), 1:int(width=64)):IndexError