Closed
Description
Post-1.0, we would like to allow arbitrary type ascription - that is annotating any expression with a type. E.g., let _ = foo(x, y: Bar<int>, z);
(type ascription on the sub-expression y
).
Detail to be nailed down - precedence (probably the same as as
).
Optional extra - type ascription on patterns, e.g. let (x: Bar<int>, y) = foo(...);
- useful when you care about the type of some part of the pattern but not others, especially when the bits you don't care about are _
.
Optional, optional extra - using the ascribed types in pattern matching for downcasting (an extension of some #349 proposals).