Fix calculation of param/result types in wit-bindgen (#5622)
This commit fixes a bug in the `bindgen!` macro for components where previously the `param` and `result` properties weren't properly calculated depending on the structure of the type and which types were visited in which order. This is simplified to use a `LiveTypes` structure from the `wit-parser` crate and relies on that to do necessary recursion.
This commit is contained in:
15
crates/component-macro/tests/codegen/simple-wasi.wit
Normal file
15
crates/component-macro/tests/codegen/simple-wasi.wit
Normal file
@@ -0,0 +1,15 @@
|
||||
interface wasi-filesystem {
|
||||
record descriptor-stat {
|
||||
}
|
||||
|
||||
enum errno { e }
|
||||
|
||||
|
||||
create-directory-at: func() -> result<_, errno>
|
||||
|
||||
stat: func() -> result<descriptor-stat, errno>
|
||||
}
|
||||
|
||||
default world wasi {
|
||||
import wasi-filesystem: self.wasi-filesystem
|
||||
}
|
||||
Reference in New Issue
Block a user