Extract per-declaration type param alignment into entry-level align_params - #3070
Merged
soutaro merged 2 commits intoAug 7, 2026
Merged
Conversation
…arams The substitution that renames a declaration's type parameters to the entry's type parameters was built inline in five places: MethodBuilder, DefinitionBuilder#define_instance, AncestorBuilder#mixin_ancestors, ModuleEntry#self_types, and AncestorBuilder#validate_super_class!. Define it once as ModuleEntry#align_params / ClassEntry#align_params and use it from all of them. The method returns nil when the declaration already uses the entry's type parameter names, so the callers can skip the substitution in the common case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TBY8ct4HpkVkZNPdsNHEDE
Type params validation runs before the alignment, so the arity mismatch raises GenericParameterMismatchError instead of building a broken substitution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TBY8ct4HpkVkZNPdsNHEDE
soutaro
merged commit Aug 7, 2026
e51608f
into
claude/module-self-type-param-alignment-2wpbja
24 checks passed
Member
Author
|
Folded into #3067. Generated by Claude Code |
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.
Stacked on #3067.
The substitution that renames a declaration's type parameters to the entry's type parameters was built inline in five places:
MethodBuilder#build_instance,DefinitionBuilder#define_instance,AncestorBuilder#mixin_ancestors,ModuleEntry#self_types, andAncestorBuilder#validate_super_class!. This PR defines it once asModuleEntry#align_params/ClassEntry#align_paramsand uses it from all of them, making the decl-to-entry name translation a defined entry-level operation instead of a copy-pasted idiom. The method returnsnilwhen the declaration already uses the entry's type parameter names — the common case — so callers skip the substitution entirely.🤖 Generated with Claude Code
https://claude.ai/code/session_01TBY8ct4HpkVkZNPdsNHEDE
Generated by Claude Code