File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -928,18 +928,21 @@ the fact that the underlying concrete type is the same is kept an encapsulated
928
928
implementation detail. For example, in the following component:
929
929
``` wasm
930
930
(component
931
- (component $C
932
- (type $r (resource (rep i32)))
933
- (export "r1" (type (sub $r)))
934
- (export "r2" (type (sub $r)))
935
- )
936
- (instance $c (instantiate $C))
937
- (type $r1 (alias export $c "r1"))
938
- (type $r2 (alias export $c "r2"))
931
+ (type $r (resource (rep i32)))
932
+ (export "r1" (type (sub $r)))
933
+ (export "r2" (type (sub $r)))
934
+ )
935
+ ```
936
+ Any client of this component will treat ` r1 ` and ` r2 ` as totally distinct
937
+ types since this component definition has the ` componenttype ` :
938
+ ``` wasm
939
+ (component
940
+ (export "r1" (type (sub resource)))
941
+ (export "r2" (type (sub resource)))
939
942
)
940
943
```
941
- The types ` $r1 ` and ` $r2 ` are unequal. These type-checking rules for
942
- type exports mirror the * introduction * rule of [ existential types] (∃T).
944
+ The assignment of this type to the above component mirrors the * introduction *
945
+ rule of [ existential types] (∃T).
943
946
944
947
When supplying a resource type (imported * or* defined) to a type import via
945
948
` instantiate ` , type checking performs a substitution, replacing all uses of the
You can’t perform that action at this time.
0 commit comments