Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342150 - [xtend2] problem with java method overloading + extension methods
Summary: [xtend2] problem with java method overloading + extension methods
Status: CLOSED WORKSFORME
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 08:57 EDT by Moritz Eysholdt CLA
Modified: 2017-09-19 17:48 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: 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 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