From faa10fd0c3579df144d89f10cfc93fcdfc56ee5f Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Sat, 26 Apr 2025 22:13:23 +0000 Subject: [PATCH] fix(hyperlight-component-util): Fix emit_hl_unmarshal_value to return a tuple for boolean values This updates the emit_hl_unmarshal_value function to return a tuple containing the boolean value and a constant 1, which fixes the following build error if a function that has a bool as its argument is called: ``` error[E0610]: `bool` is a primitive type and therefore doesn't have fields ``` Signed-off-by: Jiaxiao (mossaka) Zhou --- src/hyperlight_component_util/src/hl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperlight_component_util/src/hl.rs b/src/hyperlight_component_util/src/hl.rs index af78fbf7c..a13ebe616 100644 --- a/src/hyperlight_component_util/src/hl.rs +++ b/src/hyperlight_component_util/src/hl.rs @@ -137,7 +137,7 @@ pub fn resolve_handleable_to_resource(s: &mut State, ht: &Handleable) -> u32 { pub fn emit_hl_unmarshal_value(s: &mut State, id: Ident, vt: &Value) -> TokenStream { match vt { - Value::Bool => quote! { if #id[0] != 0 { true } else { false } }, + Value::Bool => quote! { (if #id[0] != 0 { true } else { false }, 1) }, Value::S(_) | Value::U(_) | Value::F(_) => { let (tid, width) = rtypes::numeric_rtype(vt); let blen = width as usize / 8;