Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract "world elaboration" to a separate function #1800

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions crates/wit-component/tests/interfaces/resources.wat
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,6 @@
(type (;0;)
(component
(type (;0;)
(instance
(export (;0;) "a" (type (sub resource)))
(type (;1;) (own 0))
(type (;2;) (func (result 1)))
(export (;0;) "[constructor]a" (func (type 2)))
(type (;3;) (func))
(export (;1;) "[static]a.b" (func (type 3)))
(type (;4;) (borrow 0))
(type (;5;) (func (param "self" 4)))
(export (;2;) "[method]a.c" (func (type 5)))
)
)
(import "anon" (instance (;0;) (type 0)))
(type (;1;)
(instance
(export (;0;) "bar" (type (sub resource)))
(export (;1;) "t" (type (eq 0)))
Expand All @@ -131,14 +117,14 @@
(export (;3;) "a" (func (type 9)))
)
)
(import "foo:bar/foo" (instance (;1;) (type 1)))
(alias export 1 "bar" (type (;2;)))
(alias export 1 "t" (type (;3;)))
(type (;4;)
(import "foo:bar/foo" (instance (;0;) (type 0)))
(alias export 0 "bar" (type (;1;)))
(alias export 0 "t" (type (;2;)))
(type (;3;)
(instance
(alias outer 1 2 (type (;0;)))
(alias outer 1 1 (type (;0;)))
(export (;1;) "bar" (type (eq 0)))
(alias outer 1 3 (type (;2;)))
(alias outer 1 2 (type (;2;)))
(export (;3;) "t" (type (eq 2)))
(type (;4;) (own 1))
(type (;5;) (func (param "x" 4) (result 4)))
Expand All @@ -148,15 +134,29 @@
(export (;1;) "b" (func (type 7)))
)
)
(import "foo:bar/baz" (instance (;2;) (type 4)))
(alias export 2 "bar" (type (;5;)))
(import "bar" (type (;6;) (eq 5)))
(import "a" (type (;7;) (sub resource)))
(type (;8;) (own 7))
(import "foo:bar/baz" (instance (;1;) (type 3)))
(alias export 1 "bar" (type (;4;)))
(import "bar" (type (;5;) (eq 4)))
(import "a" (type (;6;) (sub resource)))
(type (;7;)
(instance
(export (;0;) "a" (type (sub resource)))
(type (;1;) (own 0))
(type (;2;) (func (result 1)))
(export (;0;) "[constructor]a" (func (type 2)))
(type (;3;) (func))
(export (;1;) "[static]a.b" (func (type 3)))
(type (;4;) (borrow 0))
(type (;5;) (func (param "self" 4)))
(export (;2;) "[method]a.c" (func (type 5)))
)
)
(import "anon" (instance (;2;) (type 7)))
(type (;8;) (own 6))
(type (;9;) (func (result 8)))
(import "[constructor]a" (func (;0;) (type 9)))
(export (;1;) "x" (func (type 9)))
(type (;10;) (own 6))
(type (;10;) (own 5))
(type (;11;) (func (result 10)))
(export (;2;) "y" (func (type 11)))
)
Expand Down
4 changes: 2 additions & 2 deletions crates/wit-component/tests/interfaces/resources.wit.print
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ interface implicit-own-handles2 {
}

world some-world {
import foo;
import baz;
import anon: interface {
resource a {
constructor();
b: static func();
c: func();
}
}
import foo;
import baz;
use baz.{bar};

resource a {
Expand Down
14 changes: 7 additions & 7 deletions crates/wit-component/tests/interfaces/world-top-level.wat
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
(component
(type (;0;)
(component
(type (;0;)
(type (;0;) (func))
(import "foo" (func (;0;) (type 0)))
(type (;1;) (func (param "arg" u32)))
(import "bar" (func (;1;) (type 1)))
(type (;2;)
(instance)
)
(import "some-interface" (instance (;0;) (type 0)))
(type (;1;) (func))
(import "foo" (func (;0;) (type 1)))
(type (;2;) (func (param "arg" u32)))
(import "bar" (func (;1;) (type 2)))
(export (;2;) "foo2" (func (type 1)))
(import "some-interface" (instance (;0;) (type 2)))
(export (;2;) "foo2" (func (type 0)))
(type (;3;) (func (result u32)))
(export (;3;) "bar2" (func (type 3)))
(type (;4;)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package foo:foo;

world foo {
import some-interface: interface {
}
import foo: func();
import bar: func(arg: u32);
import some-interface: interface {
}

export foo2: func();
export bar2: func() -> u32;
Expand Down
Loading