forked from M-Labs/artiq
Fix tests.
This commit is contained in:
parent
7c1abb25ec
commit
13e612c11b
|
@ -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 "<instance {}>".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 "<instance {} {{{}}}>".format(typ.name, attrs)
|
||||
|
@ -554,10 +554,10 @@ class TypePrinter(object):
|
|||
elif isinstance(typ, TBuiltinFunction):
|
||||
return "<function {}>".format(typ.name)
|
||||
elif isinstance(typ, (TConstructor, TExceptionConstructor)):
|
||||
if typ.name in self.recurse_guard:
|
||||
if typ in self.recurse_guard:
|
||||
return "<constructor {}>".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 "<constructor {} {{{}}}>".format(typ.name, attrs)
|
||||
|
|
|
@ -4,22 +4,22 @@
|
|||
# CHECK-L: bool:<constructor bool {}>():bool
|
||||
bool()
|
||||
|
||||
# CHECK-L: bool:<constructor bool {}>([]:list(elt='a)):bool
|
||||
# CHECK-L: bool:<constructor bool>([]:list(elt='a)):bool
|
||||
bool([])
|
||||
|
||||
# CHECK-L: int:<constructor int {}>():int(width='b)
|
||||
int()
|
||||
|
||||
# CHECK-L: int:<constructor int {}>(1.0:float):int(width='c)
|
||||
# CHECK-L: int:<constructor int>(1.0:float):int(width='c)
|
||||
int(1.0)
|
||||
|
||||
# CHECK-L: int:<constructor int {}>(1.0:float, width=64:int(width='d)):int(width=64)
|
||||
# CHECK-L: int:<constructor int>(1.0:float, width=64:int(width='d)):int(width=64)
|
||||
int(1.0, width=64)
|
||||
|
||||
# CHECK-L: float:<constructor float {}>():float
|
||||
float()
|
||||
|
||||
# CHECK-L: float:<constructor float {}>(1:int(width='e)):float
|
||||
# CHECK-L: float:<constructor float>(1:int(width='e)):float
|
||||
float(1)
|
||||
|
||||
# CHECK-L: list:<constructor list {}>():list(elt='f)
|
||||
|
|
|
@ -8,12 +8,12 @@ class c:
|
|||
def m(self):
|
||||
pass
|
||||
|
||||
# CHECK-L: c:<constructor c {a: int(width='a), f: ()->NoneType, m: (self:c)->NoneType}>
|
||||
# CHECK-L: c:<constructor c {a: int(width='a), f: ()->NoneType, m: (self:<instance c>)->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:<instance c>)->NoneType, self=<instance c>)
|
||||
c().m()
|
||||
|
|
|
@ -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 <instance c> with int(width='a) while inferring the type for self argument
|
||||
c().g()
|
||||
|
|
|
@ -61,13 +61,13 @@ IndexError()
|
|||
# CHECK-L: IndexError:<constructor IndexError {}>():IndexError
|
||||
|
||||
IndexError("x")
|
||||
# CHECK-L: IndexError:<constructor IndexError {}>("x":str):IndexError
|
||||
# CHECK-L: IndexError:<constructor IndexError>("x":str):IndexError
|
||||
|
||||
IndexError("x", 1)
|
||||
# CHECK-L: IndexError:<constructor IndexError {}>("x":str, 1:int(width=64)):IndexError
|
||||
# CHECK-L: IndexError:<constructor IndexError>("x":str, 1:int(width=64)):IndexError
|
||||
|
||||
IndexError("x", 1, 1)
|
||||
# CHECK-L: IndexError:<constructor IndexError {}>("x":str, 1:int(width=64), 1:int(width=64)):IndexError
|
||||
# CHECK-L: IndexError:<constructor IndexError>("x":str, 1:int(width=64), 1:int(width=64)):IndexError
|
||||
|
||||
IndexError("x", 1, 1, 1)
|
||||
# CHECK-L: IndexError:<constructor IndexError {}>("x":str, 1:int(width=64), 1:int(width=64), 1:int(width=64)):IndexError
|
||||
# CHECK-L: IndexError:<constructor IndexError>("x":str, 1:int(width=64), 1:int(width=64), 1:int(width=64)):IndexError
|
||||
|
|
Loading…
Reference in New Issue