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
@mhegazy we're talking about type-position typeof, not value-position.
typeof this seems useful, but more allowing more complex expressions is trickier. It's not at all apparent to a casual observer that typeof f(x)in type positions only won't evaluate the function call; the restriction to dotted identifiers is a bit of a safeguard in this respect.
Other than typeof this, what kind of uses cases do you want this for?
At the moment compiler insists on having valid identifier on right side of
typeof
so following code is not valid:even though it's possible to assign the expression to variable and then capture the type form that:
I propose to allow capturing type of any valid expression. The expression itself wouldn't be evaluated.
The text was updated successfully, but these errors were encountered: