Test Case
https://github.com/Lifeblossom/wasmtime-resource-paremeter-bug-report
Wit file:
package component:bug-report;
world example {
import resource2-interface;
import resource1-interface;
}
interface resource1-interface {
create: func() -> resource1;
resource resource1;
}
interface resource2-interface {
use resource1-interface.{resource1};
create-resource2: func(resource1: resource1) -> resource2;
do-stuff: func(resource1: resource1, resource2: resource2) -> resource2;
resource resource2;
}
Steps to Reproduce
- Clone repository
- Run cargo component build
- Run cargo test --test test
Test that compares returned resource instances will run
Expected Results
Test passes
Actual Results
Test failes on resource2 comparison - that means that create-resource2 returned the same value two times.
Versions and Environment
Wasmtime version or commit: 17.0.0
Operating system: Windows 11
Architecture: amd64
Extra Info
Test also includes method that uses both resource1 and resource2. You can comment out ensure!(res2_1 != res2_2); which causes this method to run. Invocation results in following error:
Error: unknown handle index 0
Other findings
When using debugger both res2_1 and res_2_2 have idx 0, but when res_1_1 is replaced with res_1_2 it is 1. So I guess the resource id is taken from resource that was used as parameter.
Test Case
https://github.com/Lifeblossom/wasmtime-resource-paremeter-bug-report
Wit file:
Steps to Reproduce
Test that compares returned resource instances will run
Expected Results
Test passes
Actual Results
Test failes on resource2 comparison - that means that
create-resource2returned the same value two times.Versions and Environment
Wasmtime version or commit: 17.0.0
Operating system: Windows 11
Architecture: amd64
Extra Info
Test also includes method that uses both resource1 and resource2. You can comment out
ensure!(res2_1 != res2_2);which causes this method to run. Invocation results in following error:Other findings
When using debugger both
res2_1andres_2_2have idx0, but whenres_1_1is replaced withres_1_2it is1. So I guess the resource id is taken from resource that was used as parameter.