[External] : Re: Do we even need IO/VO interfaces? (was: JEP update: Value Objects)

Brian Goetz brian.goetz at oracle.com
Tue Dec 21 00:07:15 UTC 2021


>
>
>     Introducing new interfaces that have no methods is clearly source-
>     and binary compatible, so I am not particularly compelled by "some
>     very brittle and badly written code might break."  So far, no one
>     has proposed any examples that would make us reconsider that. 
>
>
> ??;
> you are forgetting inference, this code will fail to compile
>   class A {}
>   class B {}
>   var list = List.of(new A(), new B());
>   List<Object> list2 = list:
>

Good catch.  There is precedent for leaving certain interfaces out of 
inference, though; I suspect we will want to do this for these 
interfaces too.



More information about the valhalla-spec-observers mailing list