Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366359 - [Xbase] Check overloaded higher order functions
Summary: [Xbase] Check overloaded higher order functions
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: v2.5
Keywords:
Depends on:
Blocks: 406048
  Show dependency tree
 
Reported: 2011-12-12 03:38 EST by Sven Efftinge CLA
Modified: 2017-10-31 10:59 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 Sven Efftinge CLA 2011-12-12 03:38:38 EST
If a higher-order function is overloaded like this :

def foo (Function1<String,Boolean predicate) {
}

def foo(Predicate<String> predicate) { // the one from guava
}

It's not clear which one to invoke for the following expression:

foo( e | true )

The expression should therefore be marked as errorneous suggesting adding an explicit cast.
We could alternatively consider to have a higher precedence for Xbase's function types. Java8 might be a good source for deciding this.
Comment 1 Sebastian Zarnekow CLA 2013-09-15 07:15:03 EDT
Merged into master.
Comment 2 Eclipse Webmaster CLA 2017-10-31 10:48:06 EDT
Requested via bug 522520.

-M.
Comment 3 Eclipse Webmaster CLA 2017-10-31 10:59:08 EDT
Requested via bug 522520.

-M.