Skip to content

Commit a9d8e9a

Browse files
elmerbulthuisElmer Bulthuis
andauthored
Async trait function error (#1311)
* adds fixme * add failing interface * update wit * comment update * update wit * use .get in case of asyncmethod as well * cleanup --------- Co-authored-by: Elmer Bulthuis <elmerbulthuis@gmail.com>
1 parent 13b0ab0 commit a9d8e9a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

crates/rust/src/bindgen.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,10 @@ impl Bindgen for FunctionBindgen<'_, '_> {
897897
// Automatically convert `Borrow<'_, AResource>` to
898898
// `&Self` since traits have `&self` as their
899899
// first arguments.
900-
if i == 0 && matches!(func.kind, FunctionKind::Method(_)) {
900+
if i == 0
901+
&& (matches!(func.kind, FunctionKind::Method(_))
902+
|| matches!(func.kind, FunctionKind::AsyncMethod(_)))
903+
{
901904
self.push_str(".get()")
902905
}
903906
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package wha:hoo;
2+
3+
interface iii {
4+
resource rrr {
5+
fff: async func();
6+
}
7+
}
8+
9+
world core {
10+
export iii;
11+
}

0 commit comments

Comments
 (0)