Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/cvl/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ Child.ParentFileType invalid2; // user-defined types are not inherited
Parent.ChildFileType invalid3; // ChildFileType is not visible in Parent
```

```{note}
If two user-defined types in the {term}`scene` share the same qualified name but
have **different** definitions — for example two vendored libraries both named
Comment thread
shellygr marked this conversation as resolved.
Outdated
`Math`, one declaring `enum Rounding { Floor, Ceil, Trunc, Expand }` and the other
`enum Rounding { Down, Up, Zero }` — then `Math.Rounding` is ambiguous and is
rejected. (Same-named types with *identical* definitions are treated as one type
and remain usable.) To disambiguate, qualify the type by a contract that *imports*
the definition you want, rather than by the duplicated declaring library: if `Vault`
imports the first `Math`, then `Vault.Rounding` names that library's `Rounding`.
Comment thread
shellygr marked this conversation as resolved.
Outdated
Use a contract that imports only the one definition — a contract that imports
*both* is itself ambiguous.
```

Additional CVL types
--------------------

Expand Down
Loading