Bug 203905 - [1.5][compiler] shows wrong error with generics
Summary: [1.5][compiler] shows wrong error with generics
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: 3.3.2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL: http://screencast.com/t/9zkheAjxdAE
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-18 20:49 EDT by Stepan Koltsov CLA
Modified: 2008-09-16 09:52 EDT (History)
3 users (show)

See Also:
philippe_mulet: pmc_approved+


Attachments
Proposed patch (1.08 KB, patch)
2007-09-19 23:57 EDT, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stepan Koltsov CLA 2007-09-18 20:49:36 EDT
Example code:

===
package ru.yandex.temp;

public abstract class Function1<A, B> {
	public abstract B apply(A a);
	
	/** (f andThen g)(x) = g(f(x)) */
	public <C> Function1<A, C> andThen(final Function1<B, C> g) {
		return new Function1<A, C>() {
			public C apply(A a) {
				return g.apply(Function1.this.apply(a));
			}
		};
	}
	
	/** (f compose g)(x) = f(g(x)) */
	public <C> Function1<C, B> compose(final Function1<C, A> g) {
		return g.andThen(this);
	}
}
===

Screenshot with error:

http://screencast.com/t/9zkheAjxdAE

Error persists.
Comment 1 Philipe Mulet CLA 2007-09-19 23:57:37 EDT
Created attachment 78819 [details]
Proposed patch
Comment 2 Philipe Mulet CLA 2007-09-20 00:00:45 EDT
Added GenericTypeTest#test1171
Comment 3 Philipe Mulet CLA 2007-09-20 07:59:11 EDT
Released for 3.4M3.
Fixed
Comment 4 Philipe Mulet CLA 2007-09-20 08:00:57 EDT
should backport to 3.3.2
Comment 5 Philipe Mulet CLA 2007-10-10 04:28:23 EDT
Released for 3.3.2
Fixed
Comment 6 Maxime Daniel CLA 2007-10-29 12:47:28 EDT
Verified for 3.4 M3 using build I20071029-0010.
Comment 7 Jerome Lanneluc CLA 2007-11-22 10:26:41 EST
The compiler shouldn't be performing such double substitutions. Fix is safe, got tested heavily.
Comment 8 Philipe Mulet CLA 2007-11-23 09:21:10 EST
+1 for 3.3.2
Comment 9 Stepan Koltsov CLA 2007-12-11 11:21:32 EST
Someone knows when some version with bug fixed will be released?
Comment 10 David Audel CLA 2008-01-24 04:38:22 EST
Verified for 3.3.2 using build M20080123-0800