Open kavon opened 5 years ago
Replacing the definition of add
in the above with
fun asInt a = (case a
of Zero => 0
| One => 1
| Val a => a
(* end case *))
fun add a b = Val ((asInt a) + (asInt b))
changes the number of type mismatches, but does not solve the issue
➤ ../trunk-pmlc/bin/pmlc -Cbom.check-all=true fib-datatype.pml
***** Bogus BOM in Main after case-simplify *****
** invalid cast:(_t<D85C>#1:int) = (int)left<F8C4>#3:any
** invalid cast:(_t<D862>#1:int) = (int)right<F8C5>#3:any
** type mismatch in return from fib<F8C2>#3.3
== expected any
== but found int
** invalid cast:(_t<D73A>#1:int) = (int)ans<F8D1>#3:any
broken BOM dumped to broken-BOM
bom/check-bom.sml:544.11-544.28: Fail: broken BOM
-Cbom.enable-unbox=false
doesn't change this message either.
Seems there's a bug in case simplify? I'm using d5dfda20e063ce4c49f82555121ff95fafae1c76
See
fib-datatype.pml
below: