Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#720 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
compilers

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
24
Fork
5
Merge trung bình
10 giờ 11 phút
Pull request đã merge (30 ngày)
572

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Open-MBEE/OpenSysML

Tất cả issue của Open-MBEE/OpenSysML

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.