Skip to content

Commit 9369149

Browse files
committed
Add implicit imports test
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
1 parent 85e0651 commit 9369149

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package test:comp targets test:comp/foo;
2+
3+
interface indirect-dependency {
4+
variant my-variant {
5+
foo
6+
}
7+
}
8+
9+
interface direct-dependency {
10+
use indirect-dependency.{my-variant};
11+
12+
fun: func() -> my-variant;
13+
}
14+
15+
world foo {
16+
import a: direct-dependency;
17+
}
18+
19+
20+
let i = new foo:bar { ... };
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
failed to resolve document
2+
3+
× import `a` has a mismatched type for target world `test:comp/foo`
4+
╰─▶ expected instance, found function
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(component
2+
(import "a" (func))
3+
(export "b" (func 0))
4+
)

0 commit comments

Comments
 (0)