Skip to content

docs(cvl): disambiguating same-name user-defined types by originating contract#478

Merged
shellygr merged 5 commits into
masterfrom
shelly/cvl-conflicting-type-disambiguation
Jul 10, 2026
Merged

docs(cvl): disambiguating same-name user-defined types by originating contract#478
shellygr merged 5 commits into
masterfrom
shelly/cvl-conflicting-type-disambiguation

Conversation

@shellygr

@shellygr shellygr commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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 different enum 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

shellygr and others added 2 commits July 1, 2026 20:55
… 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>
Comment thread docs/cvl/types.md Outdated
shellygr and others added 2 commits July 1, 2026 22:28
…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>
Comment thread docs/cvl/types.md Outdated
@shellygr
shellygr merged commit c19ad01 into master Jul 10, 2026
2 checks passed
@shellygr
shellygr deleted the shelly/cvl-conflicting-type-disambiguation branch July 10, 2026 19:11
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.

1 participant