remove the :: after type names in "as" expressions #1686
Labels
A-frontend
Area: Compiler frontend (errors, parsing and HIR)
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Currently, you must write
foo as bar::<X>
if the type you are casting to contains a type parameter. I find this very unintuitive. I think the rule "type names do not require ::, explicit function type parameters do" is easy enough to explain. But the rule "::
are needed in expressions, but only where it might cause ambiguity" is a bit more troublesome.I realize there is a kind of ambiguity (
foo as uint < 5
) but I am ok with having to write(foo as uint) < 5
in this case. I think this will come up less often than casting to parameterized interfaces.The text was updated successfully, but these errors were encountered: