Lambda's and keys shouldn't give errors for nesting big maps.

This commit is contained in:
Sander Spies 2020-03-26 09:23:43 +01:00
parent 7e59312454
commit cb54cd1210

View File

@ -18,7 +18,7 @@ let rec check_no_nested_bigmap is_in_bigmap e =
| T_operator (TC_big_map (_, _)) when is_in_bigmap -> | T_operator (TC_big_map (_, _)) when is_in_bigmap ->
fail @@ Errors.no_nested_bigmap fail @@ Errors.no_nested_bigmap
| T_operator (TC_big_map (key, value)) -> | T_operator (TC_big_map (key, value)) ->
let%bind _ = check_no_nested_bigmap true key in let%bind _ = check_no_nested_bigmap false key in
let%bind _ = check_no_nested_bigmap true value in let%bind _ = check_no_nested_bigmap true value in
ok () ok ()
| T_operator (TC_contract t) | T_operator (TC_contract t)
@ -27,11 +27,14 @@ let rec check_no_nested_bigmap is_in_bigmap e =
| T_operator (TC_set t) -> | T_operator (TC_set t) ->
let%bind _ = check_no_nested_bigmap is_in_bigmap t in let%bind _ = check_no_nested_bigmap is_in_bigmap t in
ok () ok ()
| T_operator (TC_map (a, b)) | T_operator (TC_map (a, b)) ->
| T_operator (TC_arrow (a, b)) ->
let%bind _ = check_no_nested_bigmap is_in_bigmap a in let%bind _ = check_no_nested_bigmap is_in_bigmap a in
let%bind _ = check_no_nested_bigmap is_in_bigmap b in let%bind _ = check_no_nested_bigmap is_in_bigmap b in
ok () ok ()
| T_operator (TC_arrow (a, b)) ->
let%bind _ = check_no_nested_bigmap false a in
let%bind _ = check_no_nested_bigmap false b in
ok ()
| T_sum s -> | T_sum s ->
let es = CMap.to_list s in let es = CMap.to_list s in
let%bind _ = bind_map_list (fun l -> check_no_nested_bigmap is_in_bigmap l) es in let%bind _ = bind_map_list (fun l -> check_no_nested_bigmap is_in_bigmap l) es in
@ -41,8 +44,8 @@ let rec check_no_nested_bigmap is_in_bigmap e =
let%bind _ = bind_map_list (fun l -> check_no_nested_bigmap is_in_bigmap l) es in let%bind _ = bind_map_list (fun l -> check_no_nested_bigmap is_in_bigmap l) es in
ok () ok ()
| T_arrow { type1; type2 } -> | T_arrow { type1; type2 } ->
let%bind _ = check_no_nested_bigmap is_in_bigmap type1 in let%bind _ = check_no_nested_bigmap false type1 in
let%bind _ = check_no_nested_bigmap is_in_bigmap type2 in let%bind _ = check_no_nested_bigmap false type2 in
ok () ok ()
| T_variable _ | T_variable _
| T_constant _ -> | T_constant _ ->