Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342134

Summary: [xbase] problem with type inference
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: unspecifiedFlags: sven.efftinge: indigo+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Moritz Eysholdt CLA 2011-04-07 06:29:11 EDT
the Xten2-code 
------
package x
class Y {
  a(java.util.List<String> s) {
    s.map(e| newArrayList(e)).flatten
  }
}
------

gets compiled to 
------
public class Y {
  private final Y _this = this;
  
  public Iterable<? extends Object> a(final List<String> s) {
    final Function1<String,ArrayList<String>> function = new Function1<String,ArrayList<String>>() {
        public ArrayList<String> apply(String e) {
          ArrayList<String> _newArrayList = CollectionLiterals.<String>newArrayList(e);
          return _newArrayList;
        }
      };
    List<ArrayList<String>> _map = ListExtensions.<String, ArrayList<String>>map(s, function);
    Iterable<?> _flatten = IterableExtensions.flatten(_map);
    return _flatten;
  }
}
------


I'd expect the return type to be Iterable<String>
(and not Iterable<? extends Object>)
Comment 1 Sebastian Zarnekow CLA 2011-04-19 11:51:14 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 17:27:25 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:38:40 EDT
Closing all bugs that were set to RESOLVED before Neon.0