Diamond in type patterns?

Brian Goetz brian.goetz at oracle.com
Mon Jan 4 19:42:34 UTC 2021


> If you use pattern matching without inference, the mix between parenthesis and angle brackets rapidly becomes unreadable, so for a type pattern inside a switch, I think that even the diamond syntax is too much.
>
> So IMO we should use the same inference as the method reference for the type pattern in a switch.

That ship may unfortunately have sailed.  Currently `Foo f` declares the 
type of `f` as "raw Foo", and feature is finalized in 16.  (We had a 
long time to notice this.)


More information about the amber-spec-experts mailing list