Type subtraction also as nat->int->int and int->nat->int
This commit is contained in:
parent
adb4572bde
commit
49586b65be
@ -318,9 +318,8 @@ module Typer = struct
|
|||||||
| Some t -> ok t
|
| Some t -> ok t
|
||||||
|
|
||||||
let sub = typer_2 "SUB" @@ fun a b ->
|
let sub = typer_2 "SUB" @@ fun a b ->
|
||||||
if (eq_2 (a , b) (t_int ()))
|
if (eq_1 a (t_int ()) || eq_1 a (t_nat ()))
|
||||||
then ok @@ t_int () else
|
&& (eq_1 b (t_int ()) || eq_1 b (t_nat ()))
|
||||||
if (eq_2 (a , b) (t_nat ()))
|
|
||||||
then ok @@ t_int () else
|
then ok @@ t_int () else
|
||||||
if (eq_2 (a , b) (t_timestamp ()))
|
if (eq_2 (a , b) (t_timestamp ()))
|
||||||
then ok @@ t_int () else
|
then ok @@ t_int () else
|
||||||
|
Loading…
Reference in New Issue
Block a user