Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340950 - [Xtend][Xbase] duplicate operation check does not take type erasure into account
Summary: [Xtend][Xbase] duplicate operation check does not take type erasure into account
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-25 08:59 EDT by Christian Dietrich CLA
Modified: 2017-09-19 18:04 EDT (History)
3 users (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dietrich CLA 2011-03-25 08:59:54 EDT
I am using Xtext 2.0 M6

In Java it is not allowed to have something like

  public void _doWithList(final List<String> a) {
  }
  
  public void _doWithList(final List<Integer> a) {
  }

due type erasure.

but it is allowed to have something like

	dispatch doWithList(List<String> a) {
		
	}
	
	dispatch doWithList(List<Integer> a) {
		
	}
	
	doSomethingWithList(List<String> a) {
		
	}
	
	doSomethingWithList(List<Integer> a) {
		
	}

in your xtend2 file. i'd expect to get an error here too.

similar problem for casts

	doSomeStuff(List<String> in) {
		return in as List<CharSequence>
	}
Comment 1 Sebastian Zarnekow CLA 2011-04-26 09:00:54 EDT
Pushed to master.
Comment 2 Knut Wannheden CLA 2011-05-14 16:49:05 EDT
The check does not take generic methods into account. The following example does not result in any errors:

	def <T> bar(T t) {
	}

	def <T> bar(T t) {
	}
Comment 3 Sebastian Zarnekow CLA 2011-08-23 13:15:52 EDT
Pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 17:54:01 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:04:42 EDT
Closing all bugs that were set to RESOLVED before Neon.0