Variable not in scope after instanceof

Brian Goetz brian.goetz at oracle.com
Thu Apr 20 13:40:12 UTC 2023


> To be honest I never fully read the rules on when pattern values are 
> in scope or not, and just always assumed it matches my mental model of 
> ‘the variable is in scope if it would be definite assigned here 
> assuming the variable is definite assigned iff the match returned true’.
>

In fact, this was the design rubric: "don't make users learn a new set 
of rules, just lean on DA."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230420/274d0fe4/attachment-0001.htm>


More information about the amber-dev mailing list