Skip to content

lambdas and blocks should both have optional type decls #1275

Closed
@nikomatsakis

Description

@nikomatsakis

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.

Metadata

Metadata

Assignees

Labels

A-frontendArea: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type system

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions