Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311904 - [Xtend] Incorrect validation for duplicate method signatures
Summary: [Xtend] Incorrect validation for duplicate method signatures
Status: CLOSED WONTFIX
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 11:06 EDT by Johan Wannheden CLA
Modified: 2017-09-19 15:58 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 Johan Wannheden CLA 2010-05-06 11:06:16 EDT
Build Identifier: 20100218-1602 

The following two Xtend method signatures for "String abc" are (in M7) marked as duplicates but should infact be allowed:

String abc(String this, int var) :
    'test'
;

String abc(String this, Integer var) :
    var.arg()
;

private String arg(Integer this) :
    this != null
        ? this.toString()
        : 'null'
;


Reproducible: Always

Steps to Reproduce:
1. Create two Xtend functions as above and validate Xtend resource
Comment 1 Sven Efftinge CLA 2010-05-06 11:20:30 EDT
int and Integer both aliases for the same type (java.lang.Long). 
So the signatures are effectively identical. Please reopen if I misunderstood your point.
Comment 2 Johan Wannheden CLA 2010-05-07 09:50:48 EDT
And how about this Xtend validation:

two error messages:

1:
"Duplicate extension definition: abc(List[B]):
   List[B]"
2:
"Duplicate extension definition: abc(List[C]):
   List[C]"

for the following functions:

1:
List[B] abc(List[B] this) :
    doSomethingForB()
;

2:
List[C] abc(List[C] this) :
    doSomethingForC()
;

while type B extends A and type C extends A.

This was not marked as erroneous prior to M7.
Comment 3 Sven Efftinge CLA 2010-05-07 10:02:08 EDT
Xtend doesn't inspect the contents of lists for polymorphic dispatch. 
So we basically use type erasure which makes both signatures equal.
Comment 4 Karsten Thoms CLA 2017-09-19 15:58:25 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.