-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Description
Right now, it has a lower precedence than the arithmetic operators, but I find that I almost always want to cast a single atomic expression, not the result of a binop. I.e. foo + (bar as uint)
seems more common than (foo + bar) as uint
. When I do need the second form, I usually end up parenthesizing the binop anyway, to aid readability.
So I think as
should have a precedence higher than any of the binary operators. It'd make parsing simpler as well (moving parsing of casts into the function that handles calls, indices, etc, rather than having it be a special case in the binop parser).
Thoughts? What was the motivation for initially giving it its current precedence?
Metadata
Metadata
Assignees
Labels
No labels