From ab3a75b7547f9e2b1b81cb97061a57ecc0d22f3c Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Sun, 3 Apr 2022 00:23:32 +0100 Subject: [PATCH] wasm: fix WasmLayout for LambdaSet --- compiler/gen_wasm/src/layout.rs | 3 ++- compiler/test_gen/src/gen_primitives.rs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/gen_wasm/src/layout.rs b/compiler/gen_wasm/src/layout.rs index 8476b45fbc..33450c6680 100644 --- a/compiler/gen_wasm/src/layout.rs +++ b/compiler/gen_wasm/src/layout.rs @@ -86,9 +86,10 @@ impl WasmLayout { format: StackMemoryFormat::Decimal, }, + Layout::LambdaSet(lambda_set) => WasmLayout::new(&lambda_set.runtime_representation()), + Layout::Builtin(Str | Dict(_, _) | Set(_) | List(_)) | Layout::Struct { .. } - | Layout::LambdaSet(_) | Layout::Union(NonRecursive(_)) => Self::StackMemory { size, alignment_bytes, diff --git a/compiler/test_gen/src/gen_primitives.rs b/compiler/test_gen/src/gen_primitives.rs index ec90a89574..be6ef612a5 100644 --- a/compiler/test_gen/src/gen_primitives.rs +++ b/compiler/test_gen/src/gen_primitives.rs @@ -2660,7 +2660,7 @@ fn pattern_match_unit_tag() { // see for why this is disabled on wasm32 https://github.com/rtfeldman/roc/issues/1687 #[cfg(not(feature = "wasm-cli-run"))] #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn mirror_llvm_alignment_padding() { // see https://github.com/rtfeldman/roc/issues/1569 assert_evals_to!( @@ -2683,7 +2683,7 @@ fn mirror_llvm_alignment_padding() { } #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn lambda_set_bool() { assert_evals_to!( indoc!( @@ -2708,7 +2708,7 @@ fn lambda_set_bool() { } #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn lambda_set_byte() { assert_evals_to!( indoc!( @@ -2762,7 +2762,7 @@ fn lambda_set_struct_byte() { } #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn lambda_set_enum_byte_byte() { assert_evals_to!( indoc!(