class Primitive(NativeType):
@match(many(lazy("NativeBlock"), min=1))
def __init__(self, *blocks):
self.blocks = blocks
If you instantiate ir.Primitive() with no arguments you'll get:
Traceback (most recent call last):
File "/home/itamarst/Datawire/quark/quarkc/command.py", line 141, in main
tmp_pkg = IR.load_path(ir_name)
File "/home/itamarst/Datawire/quark/quarkc/ir.py", line 40, in load_path
return IR.load(f.read(), source=path)
File "/home/itamarst/Datawire/quark/quarkc/ir.py", line 46, in load
ir_e = eval(ir_c, {}, dict((k,g[k]) for k in __all__))
File "/home/itamarst/.quark/cache/generics.q.ir", line 1718, in <module>
Local(LocalName('a'), Primitive(), FloatLit(0.0)),
File "/home/itamarst/Datawire/quark/quarkc/match.py", line 439, in __call__
return compiled.apply(self.object, *args, **kwargs)
File "/home/itamarst/Datawire/quark/quarkc/match.py", line 182, in apply
return state.action(*args, **kwargs)
File "/home/itamarst/Datawire/quark/quarkc/tree.py", line 77, in __init__
assert False, "%s is abstract base class" % self.__class__
AssertionError: <class 'quarkc.ir.Primitive'> is abstract base class
If you look at
ir.py
you'll see this code:If you instantiate
ir.Primitive()
with no arguments you'll get:which is not helpful in debugging.