Add possibility of annotating types in `for`, `while let` and `if let`


Currently, type can be annotated everywhere except for for and the both let loops.

I propose that you can add type annotation there, like this:

for i: i32 in 0..10 { }
while let Some(x): Option<&str> = { }
if let Ok(result): Result<bool,()> = function() { }

Thoughts? Can this be added without grammar problems?

1 Like

In particular, the section on annotating patterns.

closed #4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.