Enforce Pos_or_decl.t in reasons for decl types
[hiphop-php.git] / hphp / hack / src / typing / typing_solver.mli
blob3bdf9b8a398c9504615278925f09820e02b710e1
1 (*
2 * Copyright (c) 2015, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 module Env = Typing_env
11 open Typing_defs
12 open Typing_env_types
14 (* Non-side-effecting test for subtypes.
15 result = true implies ty1 <: ty2
16 result = false implies NOT ty1 <: ty2 OR we don't know
18 val is_sub_type : env -> locl_ty -> locl_ty -> bool
20 val non_null : env -> Pos.t -> locl_ty -> env * locl_ty
22 (* Force solve all remaining unsolved type variables *)
23 val solve_all_unsolved_tyvars : env -> Errors.typing_error_callback -> env
25 val expand_type_and_solve :
26 env ->
27 ?freshen:bool ->
28 description_of_expected:string ->
29 Pos.t ->
30 locl_ty ->
31 Errors.typing_error_callback ->
32 env * locl_ty
34 val expand_type_and_solve_eq :
35 env -> locl_ty -> Errors.typing_error_callback -> env * locl_ty
37 val expand_type_and_narrow :
38 env ->
39 ?default:locl_ty ->
40 description_of_expected:string ->
41 (env -> locl_ty -> env * locl_ty option) ->
42 Pos.t ->
43 locl_ty ->
44 Errors.typing_error_callback ->
45 env * locl_ty
47 val solve_to_equal_bound_or_wrt_variance :
48 env -> Reason.t -> int -> Errors.typing_error_callback -> env
50 val close_tyvars_and_solve : env -> Errors.typing_error_callback -> env
52 val solve_all_unsolved_tyvars_gi :
53 env -> (Ident.t -> Errors.typing_error_callback) -> env
55 val bind : env -> Ident.t -> locl_ty -> env
57 val try_bind_to_equal_bound : env -> Ident.t -> env