Problem in jdk8/tl: defined in an inaccessible class or interface

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Apr 3 03:44:27 PDT 2013


Vicente,
this seems to be caused by this change in TL

http://hg.openjdk.java.net/jdk8/tl/langtools/rev/fa24eba012bd

I believe that the removal of 'erasure' caused problems when eType is a 
type-variable (as in this case).

Maurizio

On 03/04/13 09:58, Maurizio Cimadamore wrote:
> I believe this is a regression, I will look into this
>
> Maurizio
>
> On 31/03/13 20:35, Werner Dietl wrote:
>> Take this simple example:
>>
>> public class IterableTest {
>>      interface Data extends Iterable<String> { }
>>
>>      void test(Iterable<? extends Data> t) {
>>          for(Object a: t.iterator().next());
>>      }
>> }
>>
>> It compiles without errors using javac 1.6.0_27, 1.7.0_15, and 1.8.0 
>> b82.
>> However, using the current jdk8/tl version results in:
>>
>> IterableTest.java:5: error: iterator() in Iterable is defined in an
>> inaccessible class or interface
>>          for(Object a: t.iterator().next());
>>                                         ^
>>    where T is a type-variable:
>>      T extends Object declared in interface Iterable
>> 1 error
>>
>> Is this a desired error?
>> Can the error message be improved to highlight better what is wrong?
>>
>> Thanks for any help,
>> cu, WMD.
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/type-annotations-dev/attachments/20130403/b4cf6c64/attachment.html 


More information about the type-annotations-dev mailing list