-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new method `importize` is added to the Resolve. This is to allow to mutate the Resolve to state where it would resemble what a consuming component would expect to see during composition. Signed-off-by: karthik2804 <[email protected]>
- Loading branch information
1 parent
a21c5d0
commit 60b52a9
Showing
5 changed files
with
176 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// RUN: component embed --world foo --dummy % | component wit --importize | ||
|
||
package importize:importize; | ||
|
||
interface t { | ||
resource r; | ||
} | ||
interface bar { | ||
use t.{r}; | ||
record foo { | ||
x: string | ||
} | ||
importize: func(name: r); | ||
} | ||
|
||
interface qux { | ||
use bar.{foo}; | ||
blah: func(boo: foo); | ||
} | ||
|
||
interface something-else-dep { | ||
type t = u32; | ||
} | ||
|
||
world foo { | ||
export qux; | ||
export foo: func(); | ||
type s = u32; | ||
export bar: func() -> s; | ||
export something: interface { | ||
foo: func(); | ||
} | ||
export something-else: interface { | ||
use something-else-dep.{t}; | ||
bar: func() -> t; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package root:root; | ||
|
||
world root { | ||
import importize:importize/bar; | ||
import importize:importize/t; | ||
import foo: func(); | ||
import bar: func() -> s; | ||
import importize:importize/qux; | ||
import something: interface { | ||
foo: func(); | ||
} | ||
import something-else: interface { | ||
use something-else-dep.{t}; | ||
|
||
bar: func() -> t; | ||
} | ||
|
||
type s = u32; | ||
} | ||
package importize:importize { | ||
interface t { | ||
resource r; | ||
} | ||
interface bar { | ||
use t.{r}; | ||
|
||
record foo { | ||
x: string, | ||
} | ||
|
||
importize: func(name: r); | ||
} | ||
interface something-else-dep { | ||
type t = u32; | ||
} | ||
interface qux { | ||
use bar.{foo}; | ||
|
||
blah: func(boo: foo); | ||
} | ||
world foo { | ||
import t; | ||
import bar; | ||
import something-else-dep; | ||
|
||
type s = u32; | ||
|
||
export foo: func(); | ||
export bar: func() -> s; | ||
export qux; | ||
export something: interface { | ||
foo: func(); | ||
} | ||
export something-else: interface { | ||
use something-else-dep.{t}; | ||
|
||
bar: func() -> t; | ||
} | ||
} | ||
} |