Explictly capture variables in blocks

I would prefer this as a rule in linter, not compiler.

This was mentioned in Review capture semantics of self :
"Explicit capture should have an explicit syntax."

Just referencing a variable in closure does not make it explicit to reason about captures. Use a capture list for explicit syntax.

At this point, I would let compiler have implicit captures, and configure explicit capture rules per project.

3 Likes