A disclaimer or two for Optional
Brian Goetz
brian.goetz at oracle.com
Sat Nov 30 21:52:21 PST 2013
There is certainly something about the current date that prohibits any consideration of further language work at this time...
Sent from my iPad
On Dec 1, 2013, at 12:28 AM, Joe Bowbeer <joe.bowbeer at gmail.com> wrote:
> Is there something about this case that prohibits compiler warnings?
>
> > It is not possible for the compiler to understand and enforce every library-based invariant.
>
> The compiler emits a lot of warnings about dubious code that should be avoided. Why wouldn't you want the compiler to warn about this one? (It seems like you're claiming that the compiler shouldn't warn about this.)
>
> This is a case where the ill-advised code seemingly works, and for all practical purposes it works. And yet it should be avoided because in Java 9 it will no longer work. Shouldn't the compiler warn about that if/when it can?
>
>
> On Sat, Nov 30, 2013 at 9:23 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
>>
>>> I'm just pointing out that this is a serious warning in the javadoc that certainly qualifies for javac integration as well (right?).
>>>
>> No, wrong.
>>
>> This is like saying that library code can't have invariants that the compiler cannot enforce.
>>
>> The compiler is not in the business of detecting every possible violation of every possible classes spec. Nor has this disclaimer of what value-based means remotely risen to the level of language feature.
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20131201/4718fc0a/attachment-0001.html
More information about the lambda-libs-spec-experts
mailing list