Michelson: export and printing for Type_too_large error

This commit is contained in:
Milo Davis 2018-01-26 23:55:09 -05:00 committed by Benjamin Canou
parent 745dda78b0
commit 695b23bd92
2 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,7 @@ let collect_error_locations errs =
| (Invalid_arity (loc, _, _, _)
| Inconsistent_type_annotations (loc, _, _)
| Unexpected_annotation loc
| Type_too_large (loc, _, _)
| Invalid_namespace (loc, _, _, _)
| Invalid_primitive (loc, _, _)
| Invalid_kind (loc, _, _)
@ -307,6 +308,11 @@ let report_errors ~details ~show_source ?parsed ppf errs =
Format.fprintf ppf
"@[<v 2>%aunexpected annotation."
print_loc loc
| Type_too_large (loc, size, maximum_size) ->
Format.fprintf ppf
"@[<v 2>%atype size (%d) exceeded maximum type size (%d)."
print_loc loc
size maximum_size
| Transfer_in_lambda loc ->
Format.fprintf ppf
"%aThe TRANSFER_TOKENS instruction cannot appear in a lambda."

View File

@ -29,6 +29,7 @@ type error += Invalid_namespace of Script.location * Script.prim * namespace * n
type error += Invalid_primitive of Script.location * Script.prim list * Script.prim
type error += Invalid_kind of Script.location * kind list * kind
type error += Missing_field of Script.prim
type error += Type_too_large : Script.location * int * int -> error
(* Instruction typing errors *)
type error += Fail_not_in_tail_position of Script.location