Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342134 - [xbase] problem with type inference
Summary: [xbase] problem with type inference
Status: CLOSED FIXED
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: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 06:29 EDT by Moritz Eysholdt CLA
Modified: 2017-09-19 17:38 EDT (History)
2 users (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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