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

Bug 341642

Summary: [Xbase] Passing complex boolean expressions to Xbase filter method
Product: [Modeling] TMF Reporter: Maxim Frolov <maxim.frolov>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: christian.dietrich.opensource, maxim.frolov, sebastian.zarnekow, sven.efftinge
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: M7   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Maxim Frolov CLA 2011-04-01 11:27:36 EDT
Build Identifier: I20110310-1119

Passing complex boolean expressions as argument to the find method of org.eclipse.xtext.xbase.lib.IterableExtensions seems to be not working in a Xtend file:

newArrayList("a", "b", "c").filter(a|a == "a" || a == "b")

The Xtext editor shows the following error:
"Invalid argument types. Expected (boolean, boolean) but got (boolean, boolean)"

In (predecessor) Xtend the complex boolean expressions were allowed in such kind of functions (e.g. in select).

Reproducible: Always
Comment 1 Sven Efftinge CLA 2011-04-04 02:52:29 EDT
The issue was caused by a link resolution deep within another link resolution.
And in that context the type of 'a' couldn't be resolved. So the issue 'INVALID_ARGUMENT_TYPES' was stored with the feature call. Later when the message is computed the types are there because we are no longer deep in a recursive linking situation.

I've fixed this by replacing the INVALID_ARGUMENT_TYPES (which is something done during linking) validation with the regular INCOMPATIBLE_TYPES (which is done after linking) validation.
Although it works and it is not a too ugly fix, it would be more reliable if we could find a way to avoid persistent resolution of proxies while resolving another proxy, such that each proxy is resolved in a clean context and not done as a side effect to other resolutions.
Comment 2 Karsten Thoms CLA 2017-09-19 17:17:04 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:28:25 EDT
Closing all bugs that were set to RESOLVED before Neon.0