-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(provider-wit-bindgen): type aliasing for nested types
When using a type alias in WIT (ex. `type str-list = vec<string>`), if that type is inside an interface and used from another interface, there is an extra alias made to it. Since bindgen sees *both* the "real" alias (in Rust `type StrList = Vec<String>`) and the local binding level alias (in Rust `type StrList = super::some::iface::StrList`), we need to make sure that the "real" alias is the one that is hoisted to the top. This commit adds some checks to ensure that the alias that is *not* a reference is sure to be hoisted to the top (all generated code uses `T`, not `super::some::iface::T`). This is a a shortcut to avoid building a type reference graph. Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
- Loading branch information
1 parent
20421f1
commit 5a3a37a
Showing
4 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.