Skip to content

Commit fb68a1f

Browse files
committed
Add a test for a dependency issue
The issue is that dependencies of implicit imports and explicit imports are not merged and thus if you've already imported a dependency of an implicit import, the dependency of the explicit import will effectively be ignored. This is an issue when the explicit import dependency has different items than the version imported as part of the implicit import.
1 parent 321c40b commit fb68a1f

5 files changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package foo:dependency;
2+
3+
interface types {
4+
record my-record {
5+
foo: string
6+
}
7+
}
8+
9+
world w {
10+
export types;
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package foo:component;
2+
3+
world w {
4+
export my-interface;
5+
}
6+
7+
interface my-interface{
8+
use foo:dependency/types.{my-record};
9+
my-func: func() -> my-record;
10+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"packages": [
3+
{
4+
"name": "foo:import",
5+
"path": "import"
6+
},
7+
{
8+
"name": "test:component",
9+
"path": "component"
10+
}
11+
],
12+
"nodes": [
13+
{
14+
"type": "import",
15+
"name": "foo:test-import/my-interface",
16+
"package": 0,
17+
"export": "foo:test-import/my-interface"
18+
},
19+
{
20+
"type": "instantiation",
21+
"package": 1
22+
}
23+
],
24+
"arguments": []
25+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package foo:dependency;
2+
3+
interface types {
4+
variant my-variant {
5+
x
6+
}
7+
}
8+
9+
world w {
10+
export types;
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package foo:test-import;
2+
3+
world w {
4+
export my-interface;
5+
}
6+
7+
interface my-interface{
8+
use foo:dependency/types.{my-variant};
9+
my-func: func() -> my-variant;
10+
}

0 commit comments

Comments
 (0)