> On Aug 11, 2020, at 6:12 PM, Brian Goetz <brian.go...@oracle.com> wrote: > . . . > > or, with a smaller hammer: > > switch (multiBox) { > case MultiBox(String a, String b, String c): ... > case MultiBox(Integer a, Integer b, Integer c): ... > final case MultiBox(Object a, Object b, Object c): ... > } > > where `final case` would mean "this covers it all, its an error if it > doesn't.” Looks like we independently came upon the same thing literally within seconds of each other. :-) Which of course is not evidence either for or against its being a good idea.
- Re: Next up for patterns: type patterns in switch Brian Goetz
- Re: Next up for patterns: type patterns in switch Brian Goetz
- Re: Next up for patterns: type patterns in switch Remi Forax
- Re: Next up for patterns: type patterns in switch Brian Goetz
- Re: Next up for patterns: type patterns in sw... forax
- Re: Next up for patterns: type patterns in sw... Brian Goetz
- Re: Next up for patterns: type patterns in sw... forax
- Re: Next up for patterns: type patterns in sw... Brian Goetz
- On the last case being explicitly total forax
- Re: On the last case being explicitly total Brian Goetz
- Re: On the last case being explicitly total Guy Steele
- Re: On the last case being explicitly total Guy Steele
- Re: Next up for patterns: type patterns in sw... Guy Steele
- Re: Next up for patterns: type patterns in sw... Brian Goetz
- Re: Next up for patterns: type patterns in sw... Guy Steele
- Re: Next up for patterns: type patterns in sw... Brian Goetz
- Re: Next up for patterns: type patterns in sw... Guy Steele
- Re: Next up for patterns: type patterns in sw... forax
- Re: Next up for patterns: type patterns in sw... Brian Goetz
- Re: Next up for patterns: type patterns in sw... forax
- Re: Next up for patterns: type patterns in sw... Brian Goetz