You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: design/mvp/WIT.md
+5-14Lines changed: 5 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,10 +283,9 @@ world union-my-world {
283
283
The `include` statement also works with [WIT package](#wit-packages-and-use) defined below with the same semantics. For example, the following World `union-my-world-a` is equivalent to `union-my-world-b`:
284
284
285
285
```wit
286
-
// b.wit
287
-
interface b { ... }
286
+
package local:demo
288
287
289
-
// a.wit
288
+
interface b { ... }
290
289
interface a { ... }
291
290
292
291
world my-world-a {
@@ -296,9 +295,6 @@ world my-world-a {
296
295
export d: interface { ... }
297
296
}
298
297
299
-
// union.wit
300
-
package local:demo
301
-
302
298
world union-my-world-a {
303
299
include my-world-a
304
300
}
@@ -344,7 +340,7 @@ world union-my-world-b {
344
340
345
341
When two or more included Worlds have the same name for an import or export, the name is considered to be in conflict. The conflict needs to be explicitly resolved by the world author using the `with` keyword. `with` allows the world author to rename the import or export to a different name.
346
342
347
-
Notice that when import or export names are IDs and since IDs are unique, there is no need to resolve name conflicts. Thus the `with` syntax is a no-op in this case. Only when import or export names are kebab names, name conflicts need to be resolved.
343
+
Notice that when import or export names are IDs and since IDs are unique, there is no need to resolve name conflicts. Thus the `with` syntax is invalid when used with `include <ID>`. Only when import or export names are kebab names, name conflicts need to be resolved.
348
344
349
345
The following example shows how to resolve name conflicts where `union-my-world-a` and `union-my-world-b` are equivalent:
350
346
@@ -365,9 +361,9 @@ world union-my-world-b {
365
361
}
366
362
```
367
363
368
-
The following example shows that `with` is a no-op when the import or export name is an ID:
364
+
The following example shows an invalid example that `with` is used when the import or export name is an ID:
0 commit comments