mozilla/rust — Issue #1686: remove the :: after type names in "as" expressions
Author: nikomatsakis
Created: 2012-01-27 17:32:53+00:00
State: open
Labels: easy, front, papercuts, rfc

Currently, you must write `foo as bar::` 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.