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

Bug 342150

Summary: [xtend2] problem with java method overloading + extension methods
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Moritz Eysholdt CLA 2011-04-07 08:57:59 EDT
with java class 
-------
public static Map<IConstraint, List<EObject>> getGrammarConstraints(Grammar grammar, EClass clazz) {...}
public static Collection<IConstraint> getGrammarConstraints(Grammar grammar) {...}
-------

the xtend2 code 
-------
grammar.grammarConstraints(clazz)
-------

erroneously binds to getGrammarConstraints(Grammar). It should link to getGrammarConstraints(Grammar, EClass).

the java class is made visible via "import static extension"
Comment 1 Sebastian Zarnekow CLA 2011-04-07 08:59:33 EDT
Is the binding wrong (e.g. the generated code is wrong) or is it the hyperlinking, that does not work?
Comment 2 Moritz Eysholdt CLA 2011-04-07 09:05:25 EDT
the hyperlinking leads me to the wrong method. So I assumed the binding is wrong.

Some more playing around shows that the java-method getGrammarConstraints is only made available as "grammarConstraints" if it only has one parameter. If it has two parameters, only "getGrammarConstraints" is visible.
Comment 3 Moritz Eysholdt CLA 2011-04-07 09:06:19 EDT
grammar.getGrammarConstraints(clazz) binds as expected to getGrammarConstraints(Grammar, EClass)
Comment 4 Sebastian Zarnekow CLA 2011-04-07 09:43:17 EDT
A short offline discussion revealed a usability problem with respect to the content proposals in Xtend. The linking and navigation is correct.
Comment 5 Karsten Thoms CLA 2017-09-19 17:37:47 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 17:48:48 EDT
Closing all bugs that were set to RESOLVED before Neon.0