Skip to content

Commit b4564cb

Browse files
committed
Add an ambiguity note
1 parent e54f2a5 commit b4564cb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

design/mvp/WIT.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,17 @@ of `wasi:http/handler` but uses the plain name `my-handler` instead of the full
14591459
interface name, which is useful when a component wants to export the same
14601460
interface multiple times or simply use a more descriptive name.
14611461

1462+
Note that the `use-path` form can have an ambiguity with the nested packages
1463+
feature (🪺) where `a:b` could mean two things. To resolve this `a:b` is lexed
1464+
as a single token instead of separate tokens, meaning:
1465+
1466+
```wit
1467+
world w {
1468+
import a:b; // error: can't import a package
1469+
import a: b; // ok, assuming `b` names an interface in scope
1470+
}
1471+
```
1472+
14621473
Note that worlds can import types and define their own types to be exported
14631474
from the root of a component and used within functions imported and exported.
14641475
The `interface` item here additionally defines the grammar for IDs used to refer

0 commit comments

Comments
 (0)