Bug 406948

Summary: [typeinference] String converted to byte[]
Product: [Modeling] TMF Reporter: Boris Brodski <Brodsky_Boris>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: karsten.thoms
Version: unspecifiedKeywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Sample Project none

Description Boris Brodski CLA 2013-04-30 15:03:05 EDT
Tested on master brunch (de85546)

Code snippet


class Test {
    def static <T> T foo(Test test, (T) => Boolean lambdaMatcher) {}
    
    def static void bar(String string) {}

    def test() {
        bar(foo [ it?.length > 0 ])  // <== ERROR & WARNING
    }
}



produces:
- ERROR: Type mismatch: cannot convert from String to byte[]
- WARNING: Null-safe feature call of feature with primitive type

In my opinion 'it' should be 'String' and neither warning or error should be issued.
Comment 1 Karsten Thoms CLA 2016-09-09 09:18:11 EDT
Created attachment 264078 [details]
Sample Project

Still an issue with 2.11