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

this in a part-owned action resolves to the action performance instead of the owning part

Aperta
#720 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
compilers

Direzione di ricerca

Start with the minimal model in bug.sysml and reproduce the issue using %load, %instantiate p, and %features p.a. Trace how this is resolved for the owned action a, using the quoted SysML rules as the expected behavior. Done means ctx resolves to owning part p and the type-mismatch error no longer occurs.

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

Descrizione

bug
Model and observed behaviour
Minimal model (`bug.sysml`), on sysml v0.9.0 (Windows):


// Written in file: bug.sysml
action def A {
    ref part ctx : P;
}
part def P {
    action a : A {
        :>> ctx = this;
    }
}
part p : P;


Command:


sysml> %load bug.sysml
sysml> %instantiate p
sysml> %features p.a


Output:


Instance: p.a (ID: 2)
Features:
  ctx: <error: feature value a.ctx: type mismatch: cannot write instance(2) (instance) to a feature typed by P>


`instance(2)` is the performance of action `a` itself (i.e. `p.a`), not `p`. So
`a.this` resolved to the action, and `:>> ctx = this` tried to write the action into a
`P`-typed feature.
What the specification requires

a is an ownedAction of part p, so a.this must be p; :>> ctx = this should
set ctx to p, with no error.

OMG SysML v2.0 (formal/2026-03-02), Part 1, §9.2.4.2.1 (Part):

"The this reference of a ownedAction is always its owning Part."

Same document, §8.4.13.2 (Action Usages — "Semantics of this"):

"... the value of this is the top-level Action in the hierarchy ..., unless that
top-level Action is itself one of the ownedActions of a Part (or one of the
ownedPerformances of an Item), in which case the value is that Part (or Item)."

Kind of gap

Valid model is rejected (false positive)

Reference implementation

No response

Version

sysml v0.9.0 Commit: ee54ea03ea3ca8fb2c796ecda364adf748c40304 Build time: 2026-09-25_01:12:11 Go version: go1.25.0

Lingua principale
Go
Stelle
33
Fork
8
Merge medio
10h 12m
PR unite (30g)
598

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.