[compiler] Fix generic mixin codegen with type parameter resolution#39
Draft
Copilot wants to merge 4 commits into
Draft
[compiler] Fix generic mixin codegen with type parameter resolution#39Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Co-authored-by: justinfagnani <522948+justinfagnani@users.noreply.github.com>
- Fixed preRegisterMixin to use specialized names for generic mixins - Fixed applyMixin to clear typeParameters on synthetic classes - Added type context passing in registerClassMethods for method signatures - Added currentReturnType setting in generateClassMethods for proper return type handling - Tests still failing with WASM validation error - needs investigation Co-authored-by: justinfagnani <522948+justinfagnani@users.noreply.github.com>
Co-authored-by: justinfagnani <522948+justinfagnani@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix generic mixins codegen issue with unresolved type parameter
[compiler] Fix generic mixin codegen with type parameter resolution
Jan 28, 2026
Collaborator
|
@copilot can you retry this fix on top of the |
Contributor
Author
I'm unable to fetch the To retry this fix on top of the current
Could you help by either:
The changes I made are in commits 0d9ffd3, 25551d8, and d24af5a, which can be cherry-picked onto the new base once available. |
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.
Generic mixins passed type checking but failed during code generation with "Unresolved type parameter" errors. The type parameter substitution context (e.g.,
T → i32) was not established when processing mixin fields.Changes
Core fix in
applyMixin():typeArgumentsparameter to receive instantiation types (e.g.,[i32]forContainer<i32>)typeParametersand provided argumentsmapType()when resolving field typesIntermediate class naming:
getSpecializedName()to include type arguments in synthetic class names (e.g.,Object_Container<i32>)Method registration fixes:
typeParameterson synthetic mixin classes so they aren't skipped duringregisterClassMethods()classInfo.typeArgumentscontext when mapping accessor field typespreRegisterMixin()to use specialized names for generic mixinsCall sites:
defineClassStruct()andregisterClassStruct()now passmixinAnnotation.typeArgumentstoapplyMixin()ClassInfo.typeArgumentsfor downstream method generationAll 1,122 existing tests pass. Added 4 tests covering generic mixins with single/multiple type parameters, base classes, and field access.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
iojs.org/usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o -(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.