File tree Expand file tree Collapse file tree
tests/graphs/import-resource-alias Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -577,7 +577,6 @@ impl<'a> TypeEncoder<'a> {
577577 }
578578
579579 fn own ( & self , state : & mut State , res : ResourceId ) -> u32 {
580- assert ! ( !state. scopes. is_empty( ) ) ;
581580 let res = state. current . resources [ self . 0 [ res] . name . as_str ( ) ] ;
582581 let index = state. current . encodable . type_count ( ) ;
583582 state. current . encodable . ty ( ) . defined_type ( ) . own ( res) ;
Original file line number Diff line number Diff line change 1+ (component
2+ (import " x" (type (;0;) (sub resource)))
3+ (import " y" (type (;1;) (eq 0 )))
4+ (type (;2;) (own 0 ))
5+ (type (;3;) (own 1 ))
6+ (type (;4;) (func (param " x" 2 ) (result 3 )))
7+ (import " f" (func (;0;) (type 4 )))
8+ (type (;5;)
9+ (component
10+ (import " x" (type (;0;) (sub resource)))
11+ (import " y" (type (;1;) (eq 0 )))
12+ (type (;2;) (own 0 ))
13+ (type (;3;) (own 1 ))
14+ (type (;4;) (func (param " x" 2 ) (result 3 )))
15+ (import " f" (func (;0;) (type 4 )))
16+ )
17+ )
18+ (import " unlocked-dep=<test:foo>" (component (;0;) (type 5 )))
19+ (instance (;0;) (instantiate 0
20+ (with " x" (type 0 ))
21+ (with " y" (type 1 ))
22+ (with " f" (func 0 ))
23+ )
24+ )
25+ )
Original file line number Diff line number Diff line change 1+ {
2+ "packages" : [
3+ {
4+ "name" : " test:foo" ,
5+ "path" : " world.wit"
6+ }
7+ ],
8+ "nodes" : [
9+ {
10+ "type" : " instantiation" ,
11+ "package" : 0
12+ }
13+ ]
14+ }
Original file line number Diff line number Diff line change 1+ package example : foo ;
2+
3+ world w {
4+ resource x ;
5+ type y = x ;
6+ import f : func (x : x ) -> y ;
7+ }
Original file line number Diff line number Diff line change @@ -765,11 +765,8 @@ impl<'a> TypeConverter<'a> {
765765 let alias_id = self . types . add_resource ( Resource {
766766 name : name. to_owned ( ) ,
767767 alias : Some ( ResourceAlias {
768- owner : match self
769- . find_owner ( ComponentAnyTypeId :: Resource ( id) )
770- . expect ( "should have owner" )
771- {
772- ( Owner :: Interface ( id) , _) => Some ( * id) ,
768+ owner : match self . find_owner ( ComponentAnyTypeId :: Resource ( id) ) {
769+ Some ( ( Owner :: Interface ( id) , _) ) => Some ( * id) ,
773770 _ => None ,
774771 } ,
775772 source : * resource_id,
You can’t perform that action at this time.
0 commit comments