Repository navigation
fix: resolve generics across modules in the declaring module - #1396
Merged
Merged
Conversation
…dule specializes it Closes #1095. Also lets two modules declare the same generic enum.
# Conflicts: # self-host/bootstrap/ir_driver.ir
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.
A generic body specialized in another module used the instantiating module's names. Its imports were the caller's, so a call from it into a third module's generic did not resolve, and a generic signature naming its own module's type picked up a same-named type in the caller. The emitter now uses the declaring module's imports while it emits a specialization, and the driver gives each module's emission the imports of the generic modules it depends on. The checker now types a generic call's signature in the declaring module.
A generic and a plain struct with one name in two modules are now kept apart. The pair is treated like two same-named generics, a module's own plain type shadows a foreign generic, and a generic impl no longer takes the plain struct's type id. Two modules that declare the same generic enum now compile, and each module's constructors and matches use its own declaration.
The std/algo workaround for the cross-module call is gone. Regression cases cover each shape, and docs/limitations.md drops the fixed entries.
Closes #1095