Cannot rename arrays

Aperta
#5,559 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, rust
Ambito
devtools

Direzione di ricerca

The report reproduces a rename mismatch in a Python function and links issue #5538 as the prior report. Read that issue and find the rename or reference-resolution entry point in Pyrefly; reproduce the example and check how rename handles the two arr_val bindings. Done means renaming the argument occurrence also updates the binding in the else branch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the Bug

This issue is a continuation of https://github.com/meta/pyrefly/issues/5538. I now see the same problem with other objects. In:

def consume(val: object, wgt: object) -> None: ...

def f(has_weights: bool, arr_out: list[list[float]]) -> None:
    if has_weights:
        arr_val = arr_out[0]
        arr_wgt = arr_out[1]
    else:
        arr_val = arr_out
        arr_wgt = None

    consume(arr_val, arr_wgt)

renaming the arr_val passed to consume does not rename the one in else.

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Lingua principale
Rust
Stelle
7.2k
Fork
578
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di facebook/pyrefly

Tutte le issue di facebook/pyrefly

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.