Bug 122610 - [1.5][compiler] Qualified this has generic type binding instead of parameterized one
Summary: [1.5][compiler] Qualified this has generic type binding instead of parameteri...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 163262 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-04 06:10 EST by Markus Keller CLA
Modified: 2006-11-07 12:02 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-01-04 06:10:47 EST
From the news:
-------------------------------------------------------------
In the following example, the eclipse compiler complains Class1.this
in the assignment statement as being incorrect.  The actual error message
is "Type mismatch: cannot convert from Class1<V,R> to
Class1<V,R>".  I think this is a valid qualified expression. Any clue what
may be wrong?

public class Class1<V, R> {
	
	private class InnerClass1 {
		void foo() {
			Class1<V, R> c = Class1.this;
		}
	}
}
-- Venkatesh Prasad Ranganath, Dept. Computing and Information Science, Kansas State University, US. web: http://www.cis.ksu.edu/~rvprasa
-------------------------------------------------------------

The problem seems to be that Class1.this has a generic type binding instead of a parameterized one. The wrong compile error also appears without the inner type:
class Class1<V, R> {
    void m() {
        Class1<V, R> c2 = this; // correct: isParameterizedType
        Class1<V, R> c3 = Class1.this; //wrong compile error: isGenericType
    }
}
Comment 1 Markus Keller CLA 2006-01-04 06:12:21 EST
I20051220-0800, same in 3.2M4.
Comment 2 Philipe Mulet CLA 2006-01-05 07:06:30 EST
Added GenericTypeTest#test879. Good diagnostic.

This problem only exists in 3.2 stream, as it is a consequence of merge of generic and parameterized bindings. One instance got mistaken.

Fixed in latest. No need to backport to 3.1.2 (where problem doesn't exist).
Comment 3 Jerome Lanneluc CLA 2006-02-14 12:03:23 EST
Verified for 3.2 M5 using build I20060214-0010
Comment 4 Olivier Thomann CLA 2006-11-07 12:02:22 EST
*** Bug 163262 has been marked as a duplicate of this bug. ***