forked from M-Labs/artiq
1
0
Fork 0

Fix default argument fiasco.

This commit is contained in:
whitequark 2015-08-28 02:50:40 -05:00
parent 6b8ef8c490
commit ac92aabce1
2 changed files with 4 additions and 2 deletions

View File

@ -105,7 +105,8 @@ class ASTSynthesizer:
if typ in self.type_map:
instance_type, constructor_type = self.type_map[typ]
else:
instance_type = types.TInstance("{}.{}".format(typ.__module__, typ.__qualname__))
instance_type = types.TInstance("{}.{}".format(typ.__module__, typ.__qualname__),
OrderedDict())
instance_type.attributes['__objectid__'] = builtins.TInt(types.TValue(32))
constructor_type = types.TConstructor(instance_type)

View File

@ -359,7 +359,8 @@ class TInstance(TMono):
was created
"""
def __init__(self, name, attributes=OrderedDict()):
def __init__(self, name, attributes):
assert isinstance(attributes, OrderedDict)
super().__init__(name)
self.attributes = attributes