On Thu, Jun 10, 2021 at 7:32 PM Guilliam Xavier <guilliam.xav...@gmail.com>
wrote:

>
>  Since `$null?->whatever(1, 'a')` currently always returns null without
> error, shouldn't `$null?->whatever(?, 'a')` return a closure (with a
> signature built from the placeholders only) that will return null when
> called (i.e. equivalent to `fn (mixed $arg1) => null` here)?
>

Ah, we can also see `$foo?->bar(?)` as simply "desugaring" to `$foo ===
null ? null : $foo->bar(?)`, so the current behavior makes sense too (and
maybe even "more")...  I guess I was confused to get a "null-implying
error" despite using a "null-safe" call syntax :s  (There's also the
possibility of not supporting it, but I guess that would be a lose-lose...)

-- 
Guilliam Xavier

Reply via email to