-
Enhancement
-
Resolution: Fixed
-
P3
-
5.0
-
b110
-
generic
-
solaris_8
-
Verified
If T is an identifier for a parameterized type, then using
"instanceof T" obviously shouldn't be legal. The compiler does enforce
this but the error message "unexpected type ... found T, required class
or array" doesn't make it obvious that this is a deliberate restriction.
--------------------------------
An example:
class T4881267 {
<T> void m(Object o) {
boolean b = o instanceof T;
}
}
###@###.### 2004-09-17
"instanceof T" obviously shouldn't be legal. The compiler does enforce
this but the error message "unexpected type ... found T, required class
or array" doesn't make it obvious that this is a deliberate restriction.
--------------------------------
An example:
class T4881267 {
<T> void m(Object o) {
boolean b = o instanceof T;
}
}
###@###.### 2004-09-17
- relates to
-
JDK-6492019 Overhaul compiler diagnostics
-
- Resolved
-