docs(cvl): disambiguating same-name user-defined types by originating contract#478
Merged
Merged
Conversation
… contract Note in the "User-defined types" section: when two different types in the scene share a qualified name (e.g. two vendored libraries both named `Math` with different `Rounding` enums), the name is ambiguous and rejected; qualify by a contract that imports the wanted definition to select it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Same-named types with identical definitions are treated as one type and stay usable; only differing definitions make the qualified name ambiguous. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shellygr
commented
Jul 1, 2026
…aint) Solidity rejects importing two same-named libraries into one file except under aliases, so a disambiguating contract normally imports only one definition; verified locally that aliased double-import compiles but its bare type name is ambiguous. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shellygr
commented
Jul 10, 2026
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.
Adds a short note to the User-defined types section of
docs/cvl/types.md.Documents the new resolver behavior (EVMVerifier): when two different user-defined types in the scene share the same qualified name — e.g. a project vendors two libraries both named
Math, each with a differentenum Rounding— that name (Math.Rounding) is ambiguous and rejected. To select one, qualify the type by a contract that imports the wanted definition (e.g.Vault.Rounding) rather than by the duplicated declaring library. The note also states the caveat that the importing contract must see a single definition, and that non-ambiguous names are unaffected.Brief and slotted right after the existing qualification rules/example.
🤖 Generated with Claude Code