Module Ocaml_typing.Mode_hint
A description of what type of item is being closed over
type ident = {category : lock_item;lid : Ocaml_parsing.Longident.t;(*Sometimes we want the ident to represent
*)M.xbut the loc can only point toM. This field would storeM.x.
}type pinpoint_desc = | Unknown| Ident of ident(*An identifier
*)| Function(*A function definition
*)| Module(*A module definition
*)| Functor(*A functor definition
*)| Structure(*A structure definition
*)| Lazy(*A lazy expression
*)| Quote(*A quoted expression
*)| Allocation(*An allocation
*)| Expression(*An arbitrary expression
*)| Class(*A class declaration
*)| Object(*An object declaration
*)| Loop(*A loop
*)| Letop(*A let op expression
*)| Cases_result(*The result of cases
*)| Pattern(*A pattern
*)| Structure_item of structure_item(*an item in a structure being pointed at
*)
Pinpoint's description to accompany pinpoint's location. It's about the syntax rather than the value. For example, we distinguish:
- between a module identifer and a module definition
- between a structure definition and a functor definition
- BUT NOT between two module identifiers where one is a functor and the other is a structure.
The constructors are not mutually exclusive - some might be more precise than others.
type pinpoint = Ocaml_parsing.Location.t * pinpoint_descA pinpoint is a location in the source code, accompanied by additional description
type region = Ocaml_parsing.Location.t * region_desctype 'd const = | Unknown : ('l * 'r) const(*The constant bound is not explained.
*)| Lazy_allocated_on_heap : (Allowance.disallowed * 'r) Allowance.pos const| Legacy : legacy -> ('l * 'r) const| Toplevel_expression : (Allowance.disallowed * 'r) Allowance.pos const| Tailcall_function : (Allowance.disallowed * 'r) Allowance.pos const| Tailcall_argument : (Allowance.disallowed * 'r) Allowance.pos const| Mutable_read : mutable_part -> (Allowance.disallowed * 'r) Allowance.neg const| Mutable_write : mutable_part -> (Allowance.disallowed * 'r) Allowance.neg const| Lazy_forced : (Allowance.disallowed * 'r) Allowance.neg const| Function_return : (Allowance.disallowed * 'r) Allowance.pos const| Stack_expression : ('l * Allowance.disallowed) Allowance.pos const| Module_allocated_on_heap : (Allowance.disallowed * 'r) Allowance.pos const| Always_dynamic : always_dynamic -> ('l * Allowance.disallowed) Allowance.neg const| Branching : ('l * Allowance.disallowed) Allowance.neg const| Lpoly_inst : (Allowance.disallowed * 'r) Allowance.neg const| Is_used_in : pinpoint -> (Allowance.disallowed * 'r) const(*A variant of
*)Is_closed_bywhere the closure mode is constant. INVARIANT: Thepinpointcannot beUnknown.| Borrowed : Ocaml_parsing.Location.t * ('l * 'r, 'd) polarity -> 'd const| Escape_region : region -> (Allowance.disallowed * 'r) const| Quoted_computation : ('l * Allowance.disallowed) Allowance.pos const| Spliced : ('l * 'r, 'd) polarity -> 'd const
constraint 'd = _ * _Hint for a constant bound. See Mode.Report.print_const for what each non-trivial constructor means.
type containing = | Tuple| Record of string * modality| Array of modality| Constructor of string * modality| Structure of structure_item * modality
type allocation = allocation_desc Ocaml_parsing.Location.loctype 'd morph = | Unknown : ('l * 'r) morph(*The morphism is not explained.
*)| Skip : ('l * 'r) morph(*The morphism doesn't change the bound and should be skipped in printing.
*)| Close_over : ('d, 'l * Allowance.disallowed) polarity * closure_details -> ('l * Allowance.disallowed) morph| Is_closed_by : ('d, Allowance.disallowed * 'r) polarity * closure_details -> (Allowance.disallowed * 'r) morph| Captured_by_partial_application : (Allowance.disallowed * 'r) morph| Adj_captured_by_partial_application : ('l * Allowance.disallowed) morph| Crossing : ('l * 'r) morph| Allocation_r : allocation -> (Allowance.disallowed * 'r) morph| Allocation_l : allocation -> ('l * Allowance.disallowed) morph| Contains_l : ('l * Allowance.disallowed, 'd) polarity * contains -> 'd morph| Is_contained_by : ('l * 'r, 'd) polarity * is_contained_by -> 'd morph| Contains_r : (Allowance.disallowed * 'r, 'd) polarity * contains -> 'd morph
constraint 'd = _ * _Hint for morphisms. When acompanied by a destination pinpoint, morph gives a source pinpoint and explains the relation between them. See Mode.Report.print_morph for what each non-trivial constructor means.