CozySynthesizer / cozy

The collection synthesizer
https://cozy.uwplse.org
Apache License 2.0
209 stars 18 forks source link

basic.ds sample spec fails under C++ flag #2

Closed seizethedave closed 7 years ago

seizethedave commented 7 years ago

...where it works for --java.

$ cozy basic.ds --c++ -
...
[('_var10806', TNativeMap(TInt(), TNativeList(TInt()))), ('_var11144', TNativeMap(TInt(), TBool())), ('_var894', TNativeMap(TInt(), TNativeList(TInt()))), ('_var12', TNativeList(TInt()))]
Code generation failed!
Implementation was dumped to /tmp/failed_codegen.py
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/bin/cozy", line 11, in <module>
    load_entry_point('Cozy', 'console_scripts', 'cozy')()
  File "/Users/dgrant/Dev/cozy/cozy/cozy/main.py", line 95, in run
    out.write(compile.CxxPrinter().visit(impl, state_map, share_info))
  File "/Users/dgrant/Dev/cozy/cozy/cozy/common.py", line 141, in visit
    return getattr(self, visit_func)(x, *args, **kwargs)
  File "/Users/dgrant/Dev/cozy/cozy/cozy/compile.py", line 694, in visit_Spec
    for (name, t) in spec.statevars))
  File "/Users/dgrant/Dev/cozy/cozy/cozy/compile.py", line 694, in <genexpr>
    for (name, t) in spec.statevars))
  File "/Users/dgrant/Dev/cozy/cozy/cozy/compile.py", line 660, in initial_value
    return self.initial_value(t.rep_type())
AttributeError: 'TNativeList' object has no attribute 'rep_type'
seizethedave commented 7 years ago

(Same for in.ds, map.ds, nested-map.ds.)

seizethedave commented 7 years ago

Fixed by de8cbe016a64fe91773d9badff3f1eb530ed8c00.

Calvin-L commented 7 years ago

However, the generated code still does not compile thanks to #4