Skip to content

Conversation

@seidewitz
Copy link
Member

This PR corrects a bug that caused an infinite recursion in the computation of imported memberships in a model with a circular recursive import. For example, with the model

package Test {
    package P {
        public import Test::**;
    }
}

calling getImportedMembership on the element Test::P resulted in a StackOverflowError.

The bug was corrected by updating MembershipImportAdapter::importMemberships to properly check whether the importedElement was in the excluded set before recursing. (Note that a similar check was already proper implemented in NamspaceImportAdapter::importMemberships.)

- The test fails with a StackOverflowError, as expected.
- Added check if importedElement is excluded before recursing.
@seidewitz seidewitz self-assigned this Jan 23, 2026
@seidewitz seidewitz added the bug Something isn't working label Jan 23, 2026
@seidewitz seidewitz added this to the 2026-01 milestone Jan 23, 2026
@seidewitz seidewitz linked an issue Jan 23, 2026 that may be closed by this pull request
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.

Get an infinite recursive import when call getImportedMembership()

2 participants