graydon/rust — Issue #1275: lambdas and blocks should both have optional type decls
Author: nikomatsakis
Created: 2011-12-09 01:00:10+00:00
State: open

Right now, lambdas must declare types for their arguments and blocks must *not*. But both are represented in more-or-less the same way and seem to go through a similar inference path in `typeck.rs`; I think we ought to make parameter types optional in both cases. Naturally, if the lambda/block is not used in an argument position, or at least being assigned to a variable of known type, we will not be able to infer a type for the arguments and so an error would occur.