WIP type-checking
[tiger.ml.git] / compiler / src / lib / tiger / tiger_error.mli
CommitLineData
b9b456cc
SK
1module Abs = Tiger_absyn
2module Pos = Tiger_position
3module Sym = Tiger_symbol
4module Typ = Tiger_env_type
5
c16dd441 6type t =
b9b456cc
SK
7 | Invalid_syntax of Pos.t
8 | Unknown_id of {id : Sym.t; pos : Pos.t}
9 | Unknown_type of {ty_id : Sym.t; pos : Pos.t}
523e2b06 10 | Id_is_a_function of {id : Sym.t; pos : Pos.t}
b9b456cc 11 | Id_not_a_function of {id : Sym.t; pos : Pos.t}
523e2b06
SK
12 | No_such_field_in_record of {field : Sym.t; record : Typ.t; pos : Pos.t}
13 | Exp_not_a_record of {ty : Typ.t; pos : Pos.t}
14 | Wrong_type of
15 { expected : Typ.t
16 ; given : Typ.t
17 ; pos : Pos.t
18 }
c16dd441 19 | Wrong_type_of_expression_in_var_dec of
b9b456cc
SK
20 { var_id : Sym.t
21 ; expected : Typ.t
22 ; given : Typ.t
23 ; pos : Pos.t
c16dd441
SK
24 }
25 | Wrong_type_used_as_record of
b9b456cc
SK
26 { ty_id : Sym.t
27 ; ty : Typ.t
28 ; pos : Pos.t
c16dd441
SK
29 }
30 | Wrong_type_of_field_value of
b9b456cc
SK
31 { field_id : Sym.t
32 ; expected : Typ.t
33 ; given : Typ.t
34 ; pos : Pos.t
c16dd441
SK
35 }
36 | Wrong_type_of_arg of
b9b456cc
SK
37 { func : Sym.t
38 ; expected : Typ.t
39 ; given : Typ.t
40 ; pos : Pos.t
c16dd441
SK
41 }
42 | Wrong_number_of_args of
b9b456cc 43 { func : Sym.t
c16dd441
SK
44 ; expected : int
45 ; given : int
b9b456cc 46 ; pos : Pos.t
c16dd441
SK
47 }
48 | Invalid_operand_type of
b9b456cc 49 { oper : Abs.oper
c16dd441 50 ; valid : string list
b9b456cc
SK
51 ; given : Typ.t
52 ; pos : Pos.t
c16dd441
SK
53 }
54 | Different_operand_types of
b9b456cc
SK
55 { oper : Abs.oper
56 ; left : Typ.t
57 ; right : Typ.t
58 ; pos : Pos.t
c16dd441 59 }
7c14a966 60
c16dd441
SK
61exception T of t
62
63val raise : t -> 'a
64
65val to_string : t -> string
5da420a8
SK
66
67val is_unknown_id : t -> bool
This page took 0.022253 seconds and 4 git commands to generate.