I was a bit surprised that the type of
Int32 | Nil. The
Nil type doesn’t really make sense here.
1 always casts to
Int32, so there’s no way it would be restricted to the alternative type
In general terms: The cast
x.as?(Y) always succeeds if
typeof(x) <= Y. It can’t possibly be
Nil then, so the nilable type could be avoided.
Does this sound like a good idea, or am I missing something?