You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the return type of x.as?(T) is always T | Nil.
In some cases however, could be further reduced. This could allow removal of some code paths that would never be reached anyway.
If typeof(x) <= T, the result is always T.
If typeof(x) has no intersection with Y, the result is always Nil.
I don't see any particular reason why the return type should not be restricted as much as possible, but maybe I'm missing something.
The text was updated successfully, but these errors were encountered:
I noticed that the return type of
x.as?(T)
is alwaysT | Nil
.In some cases however, could be further reduced. This could allow removal of some code paths that would never be reached anyway.
typeof(x) <= T
, the result is alwaysT
.typeof(x)
has no intersection withY
, the result is alwaysNil
.I don't see any particular reason why the return type should not be restricted as much as possible, but maybe I'm missing something.
The text was updated successfully, but these errors were encountered: