lambda_as_optional_callable.sql 274 B

123456
  1. $callbackType = Callable<(Int32)->Int32>;
  2. $defaultFunc = Callable($callbackType, ($x)->($x));
  3. $outerType = CallableType(1, Int32, Int32, Optional<$callbackType>);
  4. $outer = Callable($outerType, ($x,$f)->(($f ?? $defaultFunc)($x)));
  5. select $outer(1,($y)->($y+1)), $outer(1);