Skip to content

ST6RI-984 (preliminary) Values computed while a reference is transiently unresolved are kept after it resolves - #825

Merged
seidewitz merged 6 commits into
masterfrom
ST6RI-984-1
Oct 29, 2026
Merged

seidewitz merged 6 commits into
masterfrom
ST6RI-984-1

Conversation

@seidewitz

@seidewitz seidewitz commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

This PR resolves some problems with reference resolution caused by changes in the 2026-09 release. This includes some spurious validation warnings and unresolved proxies remaining in the model.

Problems fixed

  1. A metadata value naming an element that found only through a second import got the warning "Bound features should have conforming types":

    package P {
        private import VerificationCases::*;
        private import VerificationMethodKind::*;
        verification def MassTest;
        verification massTests : MassTest {
    	    @VerificationMethod { kind = test; }
        }
    }
    

    After transformAll(…, true), the model contained an unresolved proxy (an AcceptActionUsage object) owned by the implied binding connector, which SysML2XMI -g writes out. The examples in sysml/src/examples/Metadata Examples got 10 such warnings.

  2. After EcoreUtil.resolveAll, a feature redefined in a type whose supertype comes from semantic metadata was inherited both redefined and not redefined ("Duplicate of inherited member name …"), for example 70 times in sysml/src/examples/Arrowhead Framework Example.

  3. (Also before 2026-09.) In kerml/src/examples/Association Examples/ProductSelection_OwnedEnds.kerml, after transformAll(…, true), an implied Subsetting owned an unresolved proxy.

Cause

A name lookup nested in the resolution of another reference can fail because the scope excludes the elements whose resolution is in progress. LazyLinkingResource then records the reference as unresolvable until the next change to the resource. Until PRs #815/#821 and #818, the result parameters and default multiplicities created during name resolution changed the resource and so discarded these records. Now the records persist, and values computed and cached in the meantime (an implicit binding connector, a redefinition closure) keep the unresolved proxy.

Changes

  1. KerMLValidator.doCheckBindingConnector – Perform proxy resolution on binding connector ends before checking the validateBindingConnectorTypeConformance constraint (which is actually not in the specification yet).

    Note. The above is a quick preliminary fix for inclusion in an incremental release, as consideration continues on a more general resolution (see PR ST6RI-984 (original) Values computed while a reference is transiently unresolved are kept after it resolves #824).

  2. FeatureAdapter.getAllRedefinedFeatures – Do not cache a result that contains an unresolved proxy.

  3. ConnectorUtil.addConnectorEndTo, TypeUtil.insertImplicitSpecializations, FeatureUtil.insertImplicitTypeFeaturings – Do not add an unresolved proxy as an owned related element.

Tests

NestedResolutionTest covers problems 1 and 2; both tests fail without these changes. The full build with all tests passes.

@vincemolnar vincemolnar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and executes as expected.
Minor comment: in the description of the first change, KerMLValidation.doCheckBindingConnector should be KerMLValidator.doCheckBindingConnector.

@seidewitz
seidewitz merged commit a9676a3 into master Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants