0xMiden / 0xMiden/air-script

Forbid name shadowing on comprehensions

オープン
#273 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。