Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345458 - [xtend] invalid java code generated
Summary: [xtend] invalid java code generated
Status: CLOSED DUPLICATE of bug 345371
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-11 12:03 EDT by Moritz Eysholdt CLA
Modified: 2011-05-12 03:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2011-05-11 12:03:34 EDT
The xtend code
------
def collectAllAmbiguousTransitions(ISyntacticSequencerPDAProvider$ISynFollowerOwner state, Set<ISyntacticSequencerPDAProvider$ISynTransition> result, Set<Object> visited) {
  if(visited.add(state)) {
    if(state instanceof ISyntacticSequencerPDAProvider$ISynTransition && (state as ISyntacticSequencerPDAProvider$ISynTransition).syntacticallyAmbiguous)
      result.add(state as ISyntacticSequencerPDAProvider$ISynTransition)
    for(follower:state.followers)
      collectAllAmbiguousTransitions(follower, result, visited)
  }
}
-------

is compiled to


-------
public Object collectAllAmbiguousTransitions(final ISynFollowerOwner state, final Set<ISynTransition> result, final Set<Object> visited) {
    Object _xifexpression = null;
    final Set<Object> typeConverted_visited = (Set<Object>)visited;
    boolean _add = typeConverted_visited.add(state);
    if (_add) {
      void _xblockexpression = null;
      {
        boolean _operator_and = false;
        if (!(state instanceof org.eclipse.xtext.serializer.ISyntacticSequencerPDAProvider.ISynTransition)) {
          _operator_and = false;
        } else {
          boolean _isSyntacticallyAmbiguous = ((ISynTransition) state).isSyntacticallyAmbiguous();
          _operator_and = BooleanExtensions.operator_and((state instanceof org.eclipse.xtext.serializer.ISyntacticSequencerPDAProvider.ISynTransition), _isSyntacticallyAmbiguous);
        }
        if (_operator_and) {
          result.add(((ISynTransition) state));
        }
        List<ISynState> _followers = state.getFollowers();
        for (ISynState follower : _followers) {
          this.collectAllAmbiguousTransitions(follower, result, visited);
        }
        _xblockexpression = (null);
      }
    }
    return _xifexpression;
  }
------------

which is syntactically incorrect because of

------
	void is an invalid type for the variable _xblockexpression
	_xblockexpression cannot be resolved to a variable

java.lang.Error: Unresolved compilation problems: 
	void is an invalid type for the variable _xblockexpression
	_xblockexpression cannot be resolved to a variable
-------
Comment 1 Sven Efftinge CLA 2011-05-12 03:51:01 EDT

*** This bug has been marked as a duplicate of bug 345371 ***