intersection type confusion (or javac or JLS error?)
I am confused about what methods are available for a type parameter with multiple bounds.
Consider the slightly modified version of the jls [url http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#120149]discussion [/url] on type variables:
package TypeVarMembers;
class C{
void mCDefault(){}
publicvoid mCPublic(){}
privatevoid mCPrivate(){}
protectedvoid mCProtected(){}
}
abstractclass CTextends Cimplements I{}
interface I{
void mI();
}
class X
{
<Textends C & I>void test(T t, CT ct){
t.mI();// OK
t.mCDefault();// OK
t.mCPublic();// OK
t.mCPrivate();// compile-time error
t.mCProtected();// OK
ct.mCDefault();
}
}
The modification are declaring CT abstract, putting the method test inside the class X and adding parameter of type CT to test.
When I try to compile this I get error
$ javac -g Intersection.java
Intersection.java:20: cannot find symbol
symbol: method mCDefault()
t.mCDefault(); // OK
Note that I do not get the error for similar call to CT.
Is this something I have misunderstood?
Thanks in advance for your time and responses.

