Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/rust/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1887,6 +1887,11 @@ unsafe fn call_import(&mut self, _params: Self::ParamsLower, _results: *mut u8)
return format!("{path}::{name}");
}
}
// World-level aliases live at macro root. `path_to_root()` is
// `""` at root, `"super::super::"` in stream/future payload mode.
if let TypeOwner::World(_) = self.resolve.types[id].owner {
return format!("{}{name}", self.path_to_root());
}
name
}

Expand Down
1 change: 1 addition & 0 deletions crates/test/src/csharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl LanguageMethods for Csharp {
| "async-resource-func.wit"
| "import-export-resource.wit"
| "issue-1433.wit"
| "issue-1598.wit"
| "named-fixed-length-list.wit"
| "map.wit"
)
Expand Down
14 changes: 14 additions & 0 deletions tests/codegen/issue-1598.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ async = true

package a:b;

world w {
use t.{r};
export f: async func() -> future<result<r, string>>;
}

interface t {
record r {
x: u32,
}
}
Loading