diff --git a/docs/cvl/types.md b/docs/cvl/types.md index 46907535..a6a2bf19 100644 --- a/docs/cvl/types.md +++ b/docs/cvl/types.md @@ -154,6 +154,20 @@ 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 libraries both named +`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`, and you can refer to fields using `Vault.Rounding.Floor`. +Solidity forbids importing two same-named libraries into one file except under +aliases, so a disambiguating contract normally imports just one of them; a contract +that (via aliases) imports both is itself ambiguous. +``` + Additional CVL types --------------------