Skip to content

Commit 811b5e6

Browse files
authored
add another element of type f32 to the variant test (#1094)
1 parent 327efdc commit 811b5e6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

crates/csharp/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3229,7 +3229,7 @@ fn dotnet_aligned_array(array_size: usize, required_alignment: usize) -> (usize,
32293229

32303230
fn perform_cast(op: &String, cast: &Bitcast) -> String {
32313231
match cast {
3232-
Bitcast::I32ToF32 => format!("BitConverter.Int32BitsToSingle({op})"),
3232+
Bitcast::I32ToF32 => format!("BitConverter.Int32BitsToSingle((int){op})"),
32333233
Bitcast::I64ToF32 => format!("BitConverter.Int32BitsToSingle((int){op})"),
32343234
Bitcast::F32ToI32 => format!("BitConverter.SingleToInt32Bits({op})"),
32353235
Bitcast::F32ToI64 => format!("BitConverter.SingleToInt32Bits({op})"),

tests/codegen/variants.wit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface variants {
2121
e(empty),
2222
f,
2323
g(u32),
24+
h(f32),
2425
}
2526

2627
v1-arg: func(x: v1);

0 commit comments

Comments
 (0)