From 811b5e67f08ac244853e70527659d6a446ab0469 Mon Sep 17 00:00:00 2001 From: yowl Date: Fri, 22 Nov 2024 09:55:27 -0500 Subject: [PATCH] add another element of type f32 to the variant test (#1094) --- crates/csharp/src/lib.rs | 2 +- tests/codegen/variants.wit | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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);