This commit is contained in:
NikolajDanger
2022-06-09 11:10:09 +02:00
parent 305725a986
commit 41ed1788cb
2 changed files with 6 additions and 6 deletions

View File

@@ -350,21 +350,21 @@ and checkExp (ftab : FunTable)
let elem_type = let elem_type =
match arr_type with match arr_type with
| Array t -> t | Array t -> t
| _ -> reportTypeWrongKind "third argument of reduce" "array" arr_type pos | _ -> reportTypeWrongKind "third argument of scan" "array" arr_type pos
let (f', f_argres_type) = let (f', f_argres_type) =
match checkFunArg ftab vtab pos f with match checkFunArg ftab vtab pos f with
| (f', res, [a1; a2]) -> | (f', res, [a1; a2]) ->
if a1 <> a2 then if a1 <> a2 then
reportTypesDifferent "argument types of operation in reduce" reportTypesDifferent "argument types of operation in scan"
a1 a2 pos a1 a2 pos
if res <> a1 then if res <> a1 then
reportTypesDifferent "argument and return type of operation in reduce" reportTypesDifferent "argument and return type of operation in scan"
a1 res pos a1 res pos
(f', res) (f', res)
| (_, res, args) -> | (_, res, args) ->
reportArityWrong "operation in reduce" 2 (args,res) pos reportArityWrong "operation in scan" 2 (args,res) pos
if elem_type <> f_argres_type then if elem_type <> f_argres_type then
reportTypesDifferent "operation and array-element types in reduce" reportTypesDifferent "operation and array-element types in scan"
f_argres_type elem_type pos f_argres_type elem_type pos
if e_type <> f_argres_type then if e_type <> f_argres_type then
reportTypesDifferent "operation and start-element types in scan" reportTypesDifferent "operation and start-element types in scan"