-
Notifications
You must be signed in to change notification settings - Fork 30
Description
This is a bit complicated of a repro, but here's a failing test to follow along with: [repro].
Take the following package that we want to instantiate:
package foo:baz;
world my-world {
use foo:dependency/types.{x};
import my-func: func() -> x;
import foo:dependency/types;
}And here's the wit for the foo:dependency package:
package foo:dependency;
interface types {
resource x;
}
world dependency-world {
export types;
}If when instantiation my-world, the foo:dependency/types and my-func imports are satisfied directly, a panic happens here:
wac/crates/wac-graph/src/encoding.rs
Line 711 in ac04147
| instance: state.current.instances[iid], |
Presumably, this happens because the my-func import still has a dependency on foo:dependency/types (because of the use of resource x) but this dependency gets lost along the way.
This is no longer error when we no longer explicitly provide the foo:dependency/types import when instantiating my-world. Then the instantiation some how knows that it depends on foo:dependency/types and it needs to be imported.
I imagine what's happening here is that the explicit import is assumed to satisfy my-func's dependency on foo:dependency/types but this assumption (which seems to be written as a comment here) is violated.