Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341246 - [xtend] Compiler produces illegal java
Summary: [xtend] Compiler produces illegal java
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 11:17 EDT by Sebastian Zarnekow CLA
Modified: 2017-09-19 17:36 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2011-03-29 11:17:58 EDT
foo() {
  new StringBuilderBasedAppendable(null)
  '''
  '''
}

yields

public StringConcatenation foo() {
    StringConcatenation _xblockexpression = null;
    {new StringBuilderBasedAppendable(null) <<-- error is here
      StringConcatenation builder = new StringConcatenation();
      builder.newLine();
      _xblockexpression = (builder);
    }
    return _xblockexpression;
}
Comment 1 Sebastian Zarnekow CLA 2011-03-29 11:23:14 EDT
Another example:

compile(Entity e) { 
  val body = body(e);
  '''
  «body»
  '''
}

body(Entity e) {}


public StringConcatenation compile(final Entity e) {
    StringConcatenation _xblockexpression = null;
    {
      _this.body(e);
      final void body = null; <<-- error is here
      StringConcatenation builder = new StringConcatenation();
      builder.newLine();
      builder.append(null, "");
      builder.newLineIfNotEmpty();
      _xblockexpression = (builder);
    }
    return _xblockexpression;
  }
  
public void body(final Entity e, final ImportManager importManager) {
}
Comment 2 Sven Efftinge CLA 2011-04-01 11:07:54 EDT
pushed to master
Comment 3 Karsten Thoms CLA 2017-09-19 17:25:05 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:36:45 EDT
Closing all bugs that were set to RESOLVED before Neon.0