Re: PM design question: Shadowing

2017-11-11 Thread Remi Forax
It's a step too far, as you said the rules for shadowing are currently the same for all constructs, let's not try to break that unity. Your first example already exist with the current construct: //field i in scope if (o instanceof Integer) { Integer i = (Integer)o; System.out.println(i);

Re: Patterns design question: Nulls

2017-11-11 Thread Remi Forax
I'm for Option, given Option 2 is not a real Option 2, see below. It's unfortunate that the behavior inside nested patterns is different from the behavior of the switch. As you said, it's the expected semantics and i think it's not a big deal if we do not allow destructuring inside a match (