thingol: fix abstraction return types in case
authorstuebinm <stuebinm@disroot.org>
Thu, 27 Apr 2023 11:58:38 +0200
changeset 77921 5016262a2384
parent 77920 1249dadc9506
child 77922 d28dcd57d2f3
thingol: fix abstraction return types in case
src/Tools/Code/code_thingol.ML
--- a/src/Tools/Code/code_thingol.ML	Thu Apr 27 17:06:03 2023 +0200
+++ b/src/Tools/Code/code_thingol.ML	Thu Apr 27 11:58:38 2023 +0200
@@ -818,7 +818,7 @@
   ##>> translate_case ctxt algbr eqngr permissive some_thm pattern_schema (c_ty, ts1)
   ##>> translate_typ ctxt algbr eqngr permissive rty
   ##>> fold_map (translate_term ctxt algbr eqngr permissive some_thm NONE) ts2
-  #>> (fn (((vs_tys, t), rty), ts) => (vs_tys `|==> (t, rty)) `$$ ts)
+  #>> (fn (((vs_tys, t), rty), ts) => (vs_tys `|==> (t, case rty of "fun" `%% [_, rty] => rty | _ => rty)) `$$ ts)
 and translate_app ctxt algbr eqngr permissive some_thm some_abs (c_ty as (c, ty), ts) =
   case Code.get_case_schema (Proof_Context.theory_of ctxt) c of
     SOME (wanted, pattern_schema) =>