diff --git a/crates/csharp/src/lib.rs b/crates/csharp/src/lib.rs index 2081a433..a771954f 100644 --- a/crates/csharp/src/lib.rs +++ b/crates/csharp/src/lib.rs @@ -3229,7 +3229,7 @@ fn dotnet_aligned_array(array_size: usize, required_alignment: usize) -> (usize, fn perform_cast(op: &String, cast: &Bitcast) -> String { match cast { - Bitcast::I32ToF32 => format!("BitConverter.Int32BitsToSingle({op})"), + Bitcast::I32ToF32 => format!("BitConverter.Int32BitsToSingle((int){op})"), Bitcast::I64ToF32 => format!("BitConverter.Int32BitsToSingle((int){op})"), Bitcast::F32ToI32 => format!("BitConverter.SingleToInt32Bits({op})"), Bitcast::F32ToI64 => format!("BitConverter.SingleToInt32Bits({op})"), diff --git a/tests/codegen/variants.wit b/tests/codegen/variants.wit index 6d0feef8..4b3023e5 100644 --- a/tests/codegen/variants.wit +++ b/tests/codegen/variants.wit @@ -21,6 +21,7 @@ interface variants { e(empty), f, g(u32), + h(f32), } v1-arg: func(x: v1);