Amazing code generation failure
In r73 of http://buildfarm.st.ewi.tudelft.nl/ptg/repos/Gamestile/Gamestile we get the following compile failure:
/home/sverre/TUDelft/MDSD/Gamestile/.servletapp/build.xml:57: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds Compiling 12 source files to /home/sverre/TUDelft/MDSD/Gamestile/.servletapp/bin/WEB-INF/classes /home/sverre/TUDelft/MDSD/Gamestile/.servletapp/src-generated/exampleapp/domain/Dominoes.java:656: illegal start of expression return (java.util.List)org.webdsl.tools.Utils.cast((_activePlayer >= 0 && _activePlayer < _hands.size() ? _hands.get(_activePlayer) : null).setupForPropertyEvents(hibSession, out).getStones(), java.util.List.class); ^ /home/sverre/TUDelft/MDSD/Gamestile/.servletapp/src-generated/exampleapp/domain/Dominoes.java:656: ';' expected return (java.util.List)org.webdsl.tools.Utils.cast((_activePlayer >= 0 && _activePlayer < _hands.size() ? _hands.get(_activePlayer) : null).setupForPropertyEvents(hibSession, out).getStones(), java.util.List.class); ^ /home/sverre/TUDelft/MDSD/Gamestile/.servletapp/src-generated/exampleapp/domain/Dominoes.java:656: illegal start of expression return (java.util.List)org.webdsl.tools.Utils.cast((_activePlayer >= 0 && _activePlayer < _hands.size() ? _hands.get(_activePlayer) : null).setupForPropertyEvents(hibSession, out).getStones(), java.util.List.class); ^ 3 errorsBtw, the generated code looks a bit odd to us, in particular the : null in the ?: construct is asking for a NPE at some point.
Further inspection shows that the following fragment is responsible for the death and despair below:
function getSelectorChoices() : List<Choice> { // type of v is List<DominoesStone>, with DominoesStone being a subclass of Choice var v := hands[activePlayer].stones; var w := v as List<Choice>; return v; }
/home/sverre/TUDelft/MDSD/Gamestile/.servletapp/src-generated/exampleapp/domain/Dominoes.java:657: illegal start of expression java.util.List Dominoes_w0 = (java.util.List)org.webdsl.tools.Utils.cast(Dominoes_v0, java.util.List.class); ^ /home/sverre/TUDelft/MDSD/Gamestile/.servletapp/src-generated/exampleapp/domain/Dominoes.java:657: ';' expected java.util.List Dominoes_w0 = (java.util.List)org.webdsl.tools.Utils.cast(Dominoes_v0, java.util.List.class); ^ /home/sverre/TUDelft/MDSD/Gamestile/.servletapp/src-generated/exampleapp/domain/Dominoes.java:657: illegal start of expression java.util.List Dominoes_w0 = (java.util.List)org.webdsl.tools.Utils.cast(Dominoes_v0, java.util.List.class);Submitted by Sverre Rabbelier on 23 March 2010 at 20:32
Issue Log
On 23 March 2010 at 20:44 Sverre Rabbelier commented:
Workaround:
function getSelectorChoices() : List<Choice> { var v := hands[activePlayer].stones; var w : List<Choice>; w.addAll(v); return w; }
Log in to post comments