Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST6RI-749 Bindings with the standard library metadata causes a warning only in Jupyter environment #551

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

seidewitz
Copy link
Member

After the 2024-02 release, bindings of enumeration features of metadata usages of metadata definitions from library models, such as

part p {
    @ModelingMetadata::StatusInfo { 
        status = ModelingMetadata::StatusKind::tbd; // WARNING
    }
}

began causing "Bound features should have conforming types" warnings in the Jupyter environment. This did not happen in the Eclipse editor.

These warnings were caused by the implicit typing of the enumerated value not being properly set to its containing enumeration definition. The typing was only being established when a full transformation was done on the enumerated value declaration. In the Eclipse environment, a full transformation is done on the entire contents of a library model resource when it is read into memory. This is not the case, however, when library resources are preloaded into the Jupyter kernel for SysML, which is why the warnings on happened in the Jupyter environment. There was a change to the implementation of the typing check in 2024-02, such that the check failed if a feature had no types (which should never be the case), which is why the warnings did not happen before 2024-02.

The implicit typing of enumerated values is actually a special case of the general rules for implicit typing of variant features of variations (enumeration definitions are kinds of variation definitions). This PR moves the adding of variation typing into the implicit general type computation for usages, so that it is included in the "on demand" computation of implicit generalization during name resolution, which eliminates the spurious warnings.

@seidewitz seidewitz self-assigned this Mar 14, 2024
@seidewitz seidewitz requested a review from himi March 14, 2024 20:24
@seidewitz seidewitz added this to the 2024-03 milestone Mar 14, 2024
Copy link
Member

@himi himi left a comment

Choose a reason for hiding this comment

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

I confirmed it worked without warning in Jupyter Lab. Thank you!

@seidewitz seidewitz merged commit 7f05a84 into master Mar 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants