reject unsupported worker-wrapper source shapes

This commit is contained in:
2026-02-15 12:41:55 +00:00
parent ba72a797e5
commit 5bf83f0933
2 changed files with 26 additions and 10 deletions
+19 -1
View File
@@ -13,6 +13,13 @@ let assert_target_invalid msg term =
| Ok () -> failwith msg
| Error _ -> ()
let assert_invalid_arg msg f =
try
let _ = f () in
failwith msg
with
| Invalid_argument _ -> ()
let find_case name =
match List.find_opt (fun (case : Corpus.case) -> String.equal case.name name) Corpus.all with
| Some case -> case
@@ -72,4 +79,15 @@ let () =
wrap_body = Target.Tuple [Target.Int 0; Target.Bool true];
worker_body = Target.Tuple [Target.Var "u0"; Target.Bool true];
in_term = Target.Var "wrapper";
})
});
assert_invalid_arg
"expected unsupported worker-wrapper source shape to be rejected"
(fun () ->
Pipeline.compile
{ Pipeline.default_flags with unsafe_repr_eq = false; unsafe_strict_unroll = false }
(Types.TArrow (Types.TPair (Types.TInt, Types.TBool), Types.TPair (Types.TInt, Types.TBool)))
(Source.Lam
( "p",
Types.TPair (Types.TInt, Types.TBool),
Types.TPair (Types.TInt, Types.TBool),
Source.Pair (Source.Int 0, Source.Bool true) )))