diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/type_check.ml | 8 | ||||
| -rw-r--r-- | src/type_check.mli | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/type_check.ml b/src/type_check.ml index 37a152d4..25ebb24e 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -2392,6 +2392,14 @@ let env_of_annot (l, tannot) = match tannot with | Some t -> t.env | None -> raise (Reporting.err_unreachable l __POS__ "no type annotation") +let env_of_tannot tannot = match tannot with + | Some t -> t.env + | None -> raise (Reporting.err_unreachable Parse_ast.Unknown __POS__ "no type annotation") + +let typ_of_tannot tannot = match tannot with + | Some t -> t.typ + | None -> raise (Reporting.err_unreachable Parse_ast.Unknown __POS__ "no type annotation") + let env_of (E_aux (_, (l, tannot))) = env_of_annot (l, tannot) let typ_of_annot (l, tannot) = match tannot with diff --git a/src/type_check.mli b/src/type_check.mli index bd4c88dc..048f5cb4 100644 --- a/src/type_check.mli +++ b/src/type_check.mli @@ -347,9 +347,11 @@ val typ_error : Env.t -> Ast.l -> string -> 'a val env_of : tannot exp -> Env.t val env_of_annot : Ast.l * tannot -> Env.t +val env_of_tannot : tannot -> Env.t val typ_of : tannot exp -> typ val typ_of_annot : Ast.l * tannot -> typ +val typ_of_tannot : tannot -> typ val typ_of_pat : tannot pat -> typ val env_of_pat : tannot pat -> Env.t |
