Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion analysis/src/process_cmt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ let rec for_structure_item ~(env : Shared_types.Env.t) ~(exported : Exported.t)
|> List.iter (fun {Typedtree.tdp_pattern} ->
handle_pattern [] tdp_pattern)
| Tpat_variant (_, Some p, _) -> handle_pattern [] p
| Tpat_variant (_, None, _) | Tpat_any | Tpat_constant _ -> ()
| Tpat_variant (_, None, _) | Tpat_any | Tpat_constant _ | Tpat_interval _
->
()
in
List.iter
(fun {Typedtree.vb_pat; vb_attributes} ->
Expand Down
1 change: 1 addition & 0 deletions changes/char-range-patterns.polish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Char range patterns such as `'\u{0}' .. '\u{10FFFF}'` compile as fast as a single character, and missing-case warnings show ranges instead of listing every character.
8 changes: 5 additions & 3 deletions compiler/common/pattern_printer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ let untype typed =
| Tpat_or (pa, pb, _) -> mkpat (Ppat_or (loop pa, loop pb))
| Tpat_any | Tpat_var _ -> mkpat Ppat_any
| Tpat_constant c -> mkpat (Ppat_constant (Untypeast.constant c))
| Tpat_interval (c1, c2) ->
mkpat (Ppat_interval (Untypeast.constant c1, Untypeast.constant c2))
| Tpat_alias (p, _, _) -> loop p
| Tpat_tuple lst -> mkpat (Ppat_tuple (List.map loop lst))
| Tpat_construct (cstr_lid, cstr, lst) ->
Expand Down Expand Up @@ -109,9 +111,9 @@ let untype typed =
| Tpat_construct (_, cstr, [value]) when cstr.cstr_name = "Some" ->
Some
{pdp_key = tdp_key; pdp_pattern = loop value; pdp_optional = false}
| Tpat_var _ | Tpat_alias _ | Tpat_constant _ | Tpat_tuple _
| Tpat_construct _ | Tpat_variant _ | Tpat_record _ | Tpat_dict _
| Tpat_array _ | Tpat_or _ ->
| Tpat_var _ | Tpat_alias _ | Tpat_constant _ | Tpat_interval _
| Tpat_tuple _ | Tpat_construct _ | Tpat_variant _ | Tpat_record _
| Tpat_dict _ | Tpat_array _ | Tpat_or _ ->
Some
{
pdp_key = tdp_key;
Expand Down
2 changes: 1 addition & 1 deletion compiler/ext/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and ast0_impl_magic_number = "Caml1999M022"

and ast0_intf_magic_number = "Caml1999N022"

and cmt_magic_number = "Caml1999T045"
and cmt_magic_number = "Caml1999T046"

let get_load_path () = (Compiler_request_state.current ()).load_path
let set_load_path path = (Compiler_request_state.current ()).load_path <- path
4 changes: 3 additions & 1 deletion compiler/ml/dict_pattern.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ open Typedtree
let rec contains_dict p =
match p.pat_desc with
| Tpat_dict _ -> true
| Tpat_any | Tpat_var _ | Tpat_constant _ | Tpat_variant (_, None, _) -> false
| Tpat_any | Tpat_var _ | Tpat_constant _ | Tpat_interval _
| Tpat_variant (_, None, _) ->
false
| Tpat_alias (p, _, _) | Tpat_variant (_, Some p, _) -> contains_dict p
| Tpat_tuple ps | Tpat_construct (_, _, ps) | Tpat_array ps ->
List.exists contains_dict ps
Expand Down
Loading
Loading