Fix self-type substitution for reopened generic modules - #2255
Open
marcoroth wants to merge 1 commit into
Open
Conversation
marcoroth
added a commit
to marcoroth/herb
that referenced
this pull request
Aug 3, 2026
Bump `rbs` to `4.1` and uses a `steep` fork until soutaro/steep#2255 and soutaro/steep#2254 are resolved.
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.
This pull request fixes module self-type validation when a generic module is reopened with different type parameter names.
RBS treats the type parameters of reopened declarations positionally, so declarations using
EandElemare equivalent.Steep previously substituted every self type using the parameter names from the module's primary declaration. A self type originating from another declaration could therefore retain an unresolved type variable and incorrectly produce
RBS::ModuleSelfTypeError.The signature validator now finds the declaration that introduced each self type and uses that declaration's parameter names for substitution. A regression test covers equivalent module reopenings with differently named parameters:
This also allows the RBS 4.1.2 core and shim declarations for
Enumerableto be validated together.Resolves #2254