diff --git a/crates/compiler/test_gen/src/gen_abilities.rs b/crates/compiler/test_gen/src/gen_abilities.rs index d206b24494..273bf0a994 100644 --- a/crates/compiler/test_gen/src/gen_abilities.rs +++ b/crates/compiler/test_gen/src/gen_abilities.rs @@ -932,6 +932,29 @@ fn encode_derived_generic_tag_with_different_field_types() { ) } +#[test] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] +fn specialize_unique_newtype_records() { + assert_evals_to!( + indoc!( + r#" + app "test" + imports [Encode, Json] + provides [main] to "./platform" + + main = + when Str.fromUtf8 (Encode.toBytes {a: Bool.true} Json.toUtf8) is + Ok s -> when Str.fromUtf8 (Encode.toBytes {b: Bool.true} Json.toUtf8) is + Ok t -> "\(s)\(t)" + _ -> "" + _ -> "" + "# + ), + RocStr::from(r#"{"a":true}{"b":true}"#), + RocStr + ) +} + #[test] #[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn decode_use_stdlib() {