On Tuesday, 15 July 2025 at 20:42, Rob Landers <rob@bottled.codes> wrote:

> Hi Gina, I feel like destructuring `null` should not be the same warning as 
> other types since null auto-vivicates? to [] (an empty array). Instead, it 
> should provide the same warning as https://3v4l.org/8QPiD.

Autovivification is only about write operations, not read.
Therefore, I don't really understand that argument because destructuring is a 
read operation, and reading an offset on null emits:

> Trying to access array offset on null
(see https://3v4l.org/sMkCD#vnull)
Which is the same wording as the warning when reading an offset on a scalar:

> Warning: Trying to access array offset on int

As such, they should have the same warning here as well.

Best regards,
Gina P. Banyard

Reply via email to