Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ Notes:
* All parameter labels, result labels, record field labels, variant case
labels, flag labels, enum case labels, component import names, component
export names, instance import names and instance export names must be
unique in their containing scope.
unique in their containing scope, considering two labels that differ only in
case to be equal and thus rejected.
* Validation of `externdesc` requires the various `typeidx` type constructors
to match the preceding `sort`.
* (The `0x00` immediate of `case` may be reinterpreted in the future as the
Expand Down
6 changes: 6 additions & 0 deletions design/mvp/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,12 @@ mapped to `isXML`, `IsXml`, `is_XML` or `is_xml`, depending on the target
language/convention. The highly-restricted character set ensures that
capitalization is trivial and does not require consulting Unicode tables.

Because some casing schemes (such as all-lowercase) would lead to clashes if
two `label`s differed only in case, in all cases where "uniquness" is required
between a set of names (viz., import/export names, record field labels, variant
case labels, and function parameter/result names), two `label`s that differ
only in case are considered equal and thus rejected.

Components provide two options for naming exports, symmetric to the first two
options for naming imports:
* a **plain name** that leaves it up to the developer to "read the docs"
Expand Down
9 changes: 5 additions & 4 deletions design/mvp/WIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,10 @@ world command {
}
```

Kebab names cannot overlap and must be unique, even between imports and exports.
IDs, however, can be both imported and exported. The same interface cannot be
explicitly imported or exported twice.
Each name must be case-insensitively unique in the scope in which it is
declared. In the case of worlds, all imported names are in the same scope,
but separate from all the export names, and thus the same name can *not* be
imported twice, but *can* be both imported and exported.

[Plain Name]: Explainer.md#import-and-export-definitions

Expand Down Expand Up @@ -647,7 +648,7 @@ import unless it's explicitly listed as an export.

Functions are defined in an [`interface`][interfaces] or are listed as an
`import` or `export` from a [`world`][worlds]. Parameters to a function must all
be named and have unique names:
be named and have case-insensitively unique names:

```wit
package local:demo;
Expand Down