Skip to content

Commit 5f63d32

Browse files
committed
Add WIT.md example
1 parent ac192e4 commit 5f63d32

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

design/mvp/WIT.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,26 @@ imported into the component as well.
606606
Note that the name `"local:demo/shared"` here is derived from the name of the
607607
`interface` plus the package ID `local:demo`.
608608

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

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

0 commit comments

Comments
 (0)