Skip to content

Commit 77f7be2

Browse files
committed
Add WIT.md example
1 parent 8bbb394 commit 77f7be2

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

design/mvp/WIT.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,26 @@ imported into the component as well.
612612
Note that the name `"local:demo/shared"` here is derived from the name of the
613613
`interface` plus the package ID `local:demo`.
614614

615-
For `export`ed interfaces any transitively `use`d interface is assumed to be an
616-
import unless it's explicitly listed as an export.
615+
For `export`ed interfaces, any transitively `use`d interface is assumed to be an
616+
import unless it's explicitly listed as an export. For example, here `w1` is
617+
equivalent to `w2`:
618+
```wit
619+
interface a {
620+
resource r;
621+
}
622+
interface b {
623+
use a.{r};
624+
foo: func() -> r;
625+
}
626+
627+
world w1 {
628+
export b;
629+
}
630+
world w2 {
631+
import a;
632+
export b;
633+
}
634+
```
617635

618636
> **Note**: It's planned in the future to have "power user syntax" to configure
619637
> this on a more fine-grained basis for exports, for example being able to

0 commit comments

Comments
 (0)