Hello,

same as last post in the mailing list - this may have been suggested before
- but I had hard time finding it in the archives.

Coming from static typed languages, I love the addition of return type
annotations and extension of parameter type annotations. I also love the
fact, that types are not nullable by default.

I am reading about the proposal to add nullable types before union types
are fully implemented. This would be done by utilizing question mark (int?
/  ?int).

My question is: would it be too difficult to implement nullable types using
syntax of union types, but semantically, only max two types would be
allowed in the union and one of them would have to be null. So only allowed
forms would be:
- int | null
- null | int

I am thinking about the future, when union types become implemented and
suddenly there would be two ways how to annotate the same nullable type:
- int | null
- int?

Thanks for more insights,
Regards,
Igor

Reply via email to