Skip to content

Commit 9d9a728

Browse files
test: move issue-1598 regression into rust-only codegen.rs
1 parent 50431be commit 9d9a728

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

crates/rust/tests/codegen.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,29 @@ mod method_chaining {
235235
enable_method_chaining: true
236236
});
237237
}
238+
239+
// Regression: a named type brought in via `use interface.{T}` at world
240+
// level, embedded inside `future<result<T, _>>` on an exported function,
241+
// used to emit unresolved bare `T` references in the generated
242+
// `wit_future::vtable{N}` module. See issue #1598. The fix walks the
243+
// payload type tree and emits a `use super::super::...;` per named type
244+
// at the top of each vtable module.
245+
#[allow(unused, reason = "testing codegen, not functionality")]
246+
mod issue_1598_future_result_use {
247+
wit_bindgen::generate!({
248+
inline: r#"
249+
package a:b;
250+
251+
world w {
252+
use t.{r};
253+
export f: func() -> future<result<r, string>>;
254+
}
255+
256+
interface t {
257+
record r {
258+
x: u32,
259+
}
260+
}
261+
"#,
262+
});
263+
}

tests/codegen/issue-1598.wit

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)