0xMiden / 0xMiden/air-script

Forbid name shadowing on comprehensions

Aperta
#273 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
96
Fork
39
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.