JDK-6199146 : Javac accepts ambiguous compound type
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2004-11-23
  • Updated: 2010-04-02
  • Resolved: 2006-10-25
Related Reports
Duplicate :  
Description
Javac accepts this program:

class Test2 <T extends I1 & I2> { }
 
interface I1 {
    int getFoo();
}
 
interface I2 {
    float getFoo();
}

But correctly rejects this version:

interface I1 {
    int getFoo();
}
 
interface I2 {
    float getFoo();
}
 
class Test2 <T extends I1 & I2> { }

Comments
EVALUATION This is a spec violation. I assume the problem is that compound types are validated to early. ###@###.### 2004-11-23 07:30:34 GMT
23-11-2004