reject unsupported worker-wrapper source shapes
This commit is contained in:
+19
-1
@@ -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) )))
|
||||
|
||||
Reference in New Issue
Block a user