Skip to content

Fix TypeParam.rename to substitute variables in bounds and default types - #3068

Open
soutaro wants to merge 1 commit into
masterfrom
claude/fix-type-param-rename-substitution
Open

Fix TypeParam.rename to substitute variables in bounds and default types#3068
soutaro wants to merge 1 commit into
masterfrom
claude/fix-type-param-rename-substitution

Conversation

@soutaro

@soutaro soutaro commented Aug 6, 2026

Copy link
Copy Markdown
Member

TypeParam.rename built its substitution from the new names to themselves, making it an identity substitution, so type variables in upper/lower bounds and default types that reference other type parameters kept the old names. One visible consequence: validate_type_params raised a false GenericParameterMismatchError for compatible declarations like module M[A, B < _Foo[A]] and module M[X, Y < _Foo[X]]. The substitution now maps the old parameter names to the new variables.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TBY8ct4HpkVkZNPdsNHEDE


Generated by Claude Code

The substitution in TypeParam.rename was built from the new names to
themselves, making it an identity substitution. Type variables in upper
bounds, lower bounds, and default types that reference other type
parameters were left with the old names. One visible consequence:
`validate_type_params` raised a false GenericParameterMismatchError for
declarations like `module M[A, B < _Foo[A]]` and `module M[X, Y < _Foo[X]]`,
which are compatible modulo renaming.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TBY8ct4HpkVkZNPdsNHEDE
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