Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

allocate accepts two definitions as its ends (ReferenceSubsetting::referencedFeature must be a Feature)

已关闭
#646 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
compilers

调研方向

Start by reproducing the two allocate examples from the issue, then trace allocate relationship endpoint resolution and the ReferenceSubsetting validation that types referencedFeature as Feature. Done means definition endpoints produce a diagnostic like sysml-toolkit, while the usage form remains accepted; check the neighboring perform validation for comparison.

由索引模型根据 Issue 内容生成。

描述

Summary

allocate accepts two definitions as its ends (rather than two features/usages) with no diagnostic, even though the ends resolve through ReferenceSubsetting, whose referencedFeature is typed Feature — a Definition is not a Feature. sysml-toolkit rejects the same source.

Version: OpenSysML v0.9.0. sysml-toolkit v0.9.1 with the standard library rejects the same source (see below).

Observed

package P { action def A; part def H; allocate A to H; }

Loads with ok=True and no diagnostic in OpenSysML v0.9.0.

With usages instead of definitions:

package P { part def S { action a : A; part h : H; allocate a to h; } }

loads cleanly in both tools, as expected.

sysml-toolkit v0.9.1 (check --lib <sysml.library>) rejects the definition form:

error: ReferenceSubsetting::referencedFeature must refer to a Feature [relationship-endpoint-metaclass]

OpenSysML already distinguishes definitions from usages in the neighboring perform case — perform A; naming an action definition is (correctly) rejected, since perform must reference a usage — so this looks like an inconsistency in how the same distinction is applied to allocate.

Reference

KerML 1.1 Beta 2, 8.3.3.3.9 ReferenceSubsetting: referencedFeature : Feature {redefines subsettedFeature} — the attribute's declared type is Feature. This section's own Constraints subsection is empty ("None"): there's no separate OCL rule needed, because the requirement is the attribute's own metamodel typing. A part def/action def is a Definition-kind element, not a Feature, so it cannot satisfy referencedFeature's type at all.

SysML v2.0 (formal/2026-03-02), 7.15.2 Allocation Definitions and Usages: the section's own worked example only ever allocates usages (allocate logical.component to physical.assembly inside an allocation definition, and allocate logical ::> system to physical ::> device at usage level) — never two bare definitions.

Note on #95

This is a different claim from #95 ("Subsetting type conformance is not checked"), which your team investigated and correctly closed as not-a-bug for general Subsetting (no type-conformance constraint exists there per KerML 8.3.3.3.10). ReferenceSubsetting's referencedFeature attribute is a different, more basic thing: it isn't asking whether two feature types conform to each other, it's that the referenced element must be a Feature at all, which a Definition structurally is not. We think this survives #95's reasoning, but wanted to flag the connection explicitly rather than have it look like the same question re-asked.

Request

Diagnose an allocate (or any ReferenceSubsetting-based relationship) whose ends are not features, the way sysml-toolkit already does.

主要语言
Go
星标
24
派生
5
平均合并
10 小时 7 分钟
30 天内合并 PR
536

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Open-MBEE/OpenSysML 的其他 Issue

查看 Open-MBEE/OpenSysML 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。