✨
This commit is contained in:
@ -350,21 +350,21 @@ and checkExp (ftab : FunTable)
|
||||
let elem_type =
|
||||
match arr_type with
|
||||
| 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) =
|
||||
match checkFunArg ftab vtab pos f with
|
||||
| (f', res, [a1; a2]) ->
|
||||
if a1 <> a2 then
|
||||
reportTypesDifferent "argument types of operation in reduce"
|
||||
reportTypesDifferent "argument types of operation in scan"
|
||||
a1 a2 pos
|
||||
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
|
||||
(f', res)
|
||||
| (_, 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
|
||||
reportTypesDifferent "operation and array-element types in reduce"
|
||||
reportTypesDifferent "operation and array-element types in scan"
|
||||
f_argres_type elem_type pos
|
||||
if e_type <> f_argres_type then
|
||||
reportTypesDifferent "operation and start-element types in scan"
|
||||
|
Reference in New Issue
Block a user