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

Bug 340950

Summary: [Xtend][Xbase] duplicate operation check does not take type erasure into account
Product: [Modeling] TMF Reporter: Christian Dietrich <christian.dietrich.opensource>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: knut.wannheden, sebastian.zarnekow, sven.efftinge
Version: 2.0.0Flags: sven.efftinge: indigo+
Target Milestone: SR2   
Hardware: All   
OS: All   
Whiteboard:

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