From 7b63ae803405f1cadf824f105f99061114dacc89 Mon Sep 17 00:00:00 2001 From: Skye Soss Date: Thu, 12 Feb 2026 16:53:23 -0600 Subject: [PATCH] Fix layout of LambdaExp string patterns --- src/Compiler/Lambda/LambdaExp.sml | 2 +- test/barry/string.out.ok | 1 + test/barry/string.sml | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Lambda/LambdaExp.sml b/src/Compiler/Lambda/LambdaExp.sml index 173dcbabb..439f05d18 100644 --- a/src/Compiler/Lambda/LambdaExp.sml +++ b/src/Compiler/Lambda/LambdaExp.sml @@ -1017,7 +1017,7 @@ structure LambdaExp : LAMBDA_EXP = | SWITCH_W {switch, precision, tyname} => layoutSwitch layoutLambdaExp (fn w => "0x" ^ IntInf.fmt StringCvt.HEX w) switch | SWITCH_S sw => - layoutSwitch layoutLambdaExp (fn x => x) sw + layoutSwitch layoutLambdaExp (fn x => "\"" ^ String.toString x ^ "\"") sw | SWITCH_C sw => let fun unwildify (sw as SWITCH(lamb as VAR{lvar,...},rules,SOME e)) = (case e of diff --git a/test/barry/string.out.ok b/test/barry/string.out.ok index b52d0d17b..a0e9eb6e5 100644 --- a/test/barry/string.out.ok +++ b/test/barry/string.out.ok @@ -39,3 +39,4 @@ test22 OK test23 OK test24 OK test25 OK +test26 OK diff --git a/test/barry/string.sml b/test/barry/string.sml index 5169939ac..ad01035b6 100644 --- a/test/barry/string.sml +++ b/test/barry/string.sml @@ -371,4 +371,11 @@ val test25 = andalso not (isPrefix "Abcde" "abcde") andalso not (isPrefix "abcdE" "abcde")) +val test26 = + tst' "test26" (fn _ => + case "foo" of + "bar" => false + | "baz" => false + | "foo" => true + | _ => false) end