Forbid name shadowing on comprehensions
未关闭
- 主要语言
- Rust
- 星标
- 96
- 派生
- 39
- PR 合并指标
- 30 天内没有已合并 PR
描述
The following expression is currently allowed [ref](https://github.com/0xPolygonMiden/air-script/blob/next/air-script-core/src/access.rs#L106):
```
[x + y + z for (x, y, z) in (x, 0..5, z[1..6])]
```
In the case above, the variable `x` with the iterable is shadowed with the yielded values `x`. This can be confusing at times, and may make sense to disallow that, requiring the user to be explicit and write something like:
```
[x_ + y + z for (x_, y, z) in (x, 0..5, z[1..6])]
```
The idea is to be explicit and hopefully prevent bugs.
贡献指南
评估
这个 Issue 还没有评估数据。