More type inference changes
Liam Miller-Cushon
cushon at google.com
Thu Feb 4 01:49:59 UTC 2016
On Wed, Feb 3, 2016 at 1:54 PM, Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:
>
> This looks ok to me?
>
> I.e. the call to 'a' with O.class is fine (not unchecked) - but the next
> call to 'g' is unchecked, as the return type for 'a' is simply O and the
> target type is O<Number> - that triggers the unchecked call and that means
> that the return type of 'g' is erased to R, and then the inference variable
> of 'w' (E) is inferred as R, meaning that the return type is S<R> - which
> means the signature of 't' inside S<R> is (R)S<R>, so indeed the return
> type of that method (S<R>) seems not compatible with the return type of
> your 'f' (S<R<Number>>). Would you agree?
That makes sense, when I was looking at it earlier I missed that the call
to 'w' is not unchecked.
Thanks for investigating. I wasn't sure if these were bugs or enhancements.
I was mostly hoping to get confirmation either way, and I figured they
might be useful as tests.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20160203/18e9b948/attachment.html>
More information about the compiler-dev
mailing list