Repository navigation
fix(check): accept a feature reference to a named multiplicity - #817
Merged
Merged
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Merged
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The feature-reference rule (
passes/w8c_feature_reference.go,checkReferent) reportedMust be a valid featurefor a reference to a named multiplicity, because its test wasisUsageKind(target.Kind)andSymbolMultiplicityis not a usage kind:The condition now reads
!isUsageKind(target.Kind) && target.Kind != symbols.SymbolMultiplicity.SymbolKind.IsFeature()already classifies a multiplicity as a feature. A class or other type used as a referent still reports the error, and the accessibility check is unchanged.This false positive appeared in the reproduction for Systems-Modeling/SysML-v2-Pilot-Implementation#802, which expects no diagnostics there. The docs now say that the maintainer confirmed #802 and fixed it upstream on
ST6RI-975(commit1563e068,Type_multiplicity_SettingDelegatenow derivesmultiplicityfromownedMember). The fix is not in a release yet. With that class compiled ahead of the pinned2026-08jar, the #802 reproduction and its subclass and struct variants validate clean.Specification basis
KerML 1.1 §8.3.3.1.9:
MultiplicityspecializesFeature, so aFeatureReferenceExpressionmay name one. No row ofdocs/project/spec-compliance.mdmoves; thevalidation-constraints.mdandomg-issues.mdentries for #802 record the upstream status.How it was verified
TestW8CFeatureReferenceToMultiplicity: an in-class multiplicity, a package-level multiplicity, and the full fix(repl): exit on Ctrl-C at an empty prompt, discard the continuation otherwise #802 reproduction, all with no errors. The existing class-referent negative control inTestW8CFeatureReferenceAccessibleAndValidstill reports.validate-kerml. The pilot accepts the package-levelfeature w = pm;. Its remaining diagnostics on the in-class case come from the fix(repl): exit on Ctrl-C at an empty prompt, discard the continuation otherwise #802 delegate bug, and they disappear with theST6RI-975class.go vet ./internal/check/...,make lint,go test ./internal/check/... ./internal/semantic/..., and the training and pilot corpus gates (OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1) all pass with no rows moved. The changelog, doc-id and doc-link checks also pass.Checklist
make testandmake lintpass locally (scopedgo testabove plus the corpus gates; the full suite runs in CI)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (no gate count moved)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/9c1dd2015da0409389e714253be0fb0b
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/9c1dd2015da0409389e714253be0fb0b?variant=devin
Requested by: @HuiJun