Codegen uses too specific list types
When I generate java code with DynSem (master, b8f541a212dc2953995806590fd22daf254d58ed) for the Green Marl compiler (greenmarl2015, bf97d6b2b26d5b24af1bf59a2dd1de117a57a727) and then build, I get these errors from java like:
33. ERROR in /[...]/greenmarl/Green-Marl/editor/java/ds/generated/interpreter/NoOutArgs_0.java (at line 60) return new R_newTv_List_SimpleType_(result_out1510); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The constructor R_newTv_List_SimpleType_(NIL) is undefined
This is the simplest example I could find of the issue. It’s generated from this DynSem rule if I’m not mistaken:
NoOutArgs() -newTv-> []
The only defined constructor takes a
Submitted by Jeff Smits on 21 April 2015 at 02:38L_I_SimpleType
, whereas the least upper bound betweenNIL
andL_I_SimpleType
isINodeList
.
Issue Log
Yes, this i a known limitation of the type inference in DynSem. For now the workaround would be to write the rule causing the problem with type annotation:
NoOutArgs() -newTv-> [] : List(SimpleType)
This should give enough information to the type analysis. This kind of error typically happens when you create an empty list literal
[]
.
Also Jeff, it would be great if you would use the
master
branch of DynSem as that’s where i’m pushing updates. DynSem is still new and things change quite quickly.
Thanks for the workaround. That error is solved now.
I am on themaster
branch. I pulled, rebuild DynSem and checked if the problem still occurred before I filed this issue. I just added the commit hash to make extra clear which version of DynSem I was using. But I guess that made it less clear..
Log in to post comments