Hello,

I took the time to read you. Very interesting discussion.
I'm also interested in the type definition.

Because these two functions are equivalent:
> function foo(?int $baz) {}
> function foo(null|int $baz) {}

We could imagine a personalized null-safety type.

> typedef Refutable as null|false|NAN|INF; // I'm not sure that NAN and INF
are types
> typedef UserId as Refutable ! int;// Refutable is the type of null-safety

> function zoo(UserId $id) {} // $id is (int)
> function noo(?UserId $id) {}// $id is (null|false|NAN|INF|int)


Do you plan to use enum cases as type ?

enum MyEnum{ case Foo = 1; case Zoo = 2;}
use enum MyEnum::Foo as MyFoo;// syntaxe error
typedef Mamamia MyFoo|MyEnum::Zoo

Reply via email to