Finalizing in JDK 16 - Pattern matching for instanceof

Brian Goetz brian.goetz at oracle.com
Sun Aug 30 14:31:23 UTC 2020


> 2.  Mutability of binding variables.  
> 
> I agree,
> but in that case, does it also mean that "final" as modifier should be allowed ?
>   if (foo instanceof final Bar b) { … }

It means it’s a valid question, but a separate one; we could consider allowing final as a modifier on binding variables.  But I see no reason we have to do that now, and would prefer not too.





More information about the amber-spec-observers mailing list