[External] : Re: Diamond in type patterns (was: Reviewing feedback on patterns in switch)

Brian Goetz brian.goetz at oracle.com
Wed Jan 26 14:34:21 UTC 2022

I think we should figure out how it should work on cast and then we can happily applied it on patterns.

I’m happy to have the cast discussion happen concurrently, but right now, my priority is on patterns, as we’re already two previews into patterns-in-switch.  But I’m not ready to say “we can’t solve this for patterns unless we also solve it for cast RIGHT NOW.  So I agree with the goal (solve it everywhere, eventually) but not with the ordering constraint.

despite the syntax being the same, the diamond syntax, i don't think we can reuse the same inference rules between the new diamond and the cast diamond.

Understood.  (This is why, for example, we introduced upward and downward projection when we did var, because the rules for inference were not what we wanted for var.)  But before we go on to the details, are we agreed on the goal?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/amber-spec-experts/attachments/20220126/843a7ddd/attachment.htm>

More information about the amber-spec-experts mailing list