On Mon, Jul 24, 2017 at 10:04 AM, Jochen Theodorou <blackd...@gmx.org> wrote: > > On 23.07.2017 17:21, Guillaume Laforge wrote: > [...] > >> Speaking of pattern matching, there's Brian Goetz' proposal here, for >> pattern matching for Java: >> http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html >> We should also avoid offering a different syntax as to what might come >> up in the JDK later on, to avoid having two distinct syntaxes for the >> same thing. >> (although this proposal doesn't cover union types per se, it's something >> to factor in, in our decisions) >> > > I see one possible influence depending if we can declare a sum type or > not. Because if you can really declare one (and I really think you will > want to do that), you will potentially use it in a switch-case. That will > open a lot of problems >
Indeed, we'd certainly want to have it in switch / case, good point. -- Guillaume Laforge Apache Groovy committer & PMC Vice-President Developer Advocate @ Google Cloud Platform Blog: http://glaforge.appspot.com/ Social: @glaforge <http://twitter.com/glaforge> / Google+ <https://plus.google.com/u/0/114130972232398734985/posts>