Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Inherited succession guards resolve shadowed names in the specialization's action frame

Chiusa
#1,039 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
compilers

Direzione di ricerca

Start with EvalContext.Lookup in internal/exec/runtime/action_frame.go, which reads the action frame before scope resolution, and with ActionGraph.declaredIn from lowering. The fix changes how frame cells are keyed, so it touches several subsystems named in the issue, not one file. Done means the Base/Derived example yields c = 1, explicit redefinition still yields c = 0, and the checker, exploration, SMT and read-set paths agree.

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

Descrizione

An inherited succession guard reads names through the specialization's action frame, so a feature that a specialization declares with the same simple name as a feature of its general hides the general's feature from the inherited guard.

action def Base {
    attribute go : Boolean = true;
    attribute c : Integer := 0;
    first start;
    then action a;
    first a if go then b;
    action b { assign c := 1; }
}
action def Derived :> Base {
    attribute go : Boolean = false;
}

Performing Derived gives c = 0. The guard go was written in Base, so name resolution in its declaring scope gives Base::go and the expected result is c = 1. The checker already warns that Derived::go duplicates an inherited member name; explicit redefinition (attribute :>> go = false;) is a different case and correctly gives c = 0.

Cause. Lowering records the scope each inherited succession was declared in (ActionGraph.declaredIn), but the runtime evaluates guards against action-frame values that are keyed by canonical simple name (internal/exec/runtime/action_frame.go). EvalContext.Lookup reads the frame before scope resolution, so Base::go and Derived::go share one cell. Passing the declaring scope to guard evaluation alone does not change the result.

Fix direction. Key action-frame cells by declaration identity (or a resolved feature handle) rather than by simple name, then evaluate inherited guards in their declaring scope consistently across runtime, checker, exploration, SMT, read sets and model-form views.

Lingua principale
Go
Stelle
47
Fork
13
Merge medio
15h 52m
PR unite (30g)
906

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 Open-MBEE/OpenSysML

Tutte le issue di Open-MBEE/OpenSysML

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.