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

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Apr 3 01:58:09 PDT 2013


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.
>



More information about the type-annotations-dev mailing list