Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ccasin committed Feb 28, 2025
1 parent 42890e1 commit 39c0b0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 43 deletions.
3 changes: 1 addition & 2 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
ast_invariants
depend
parser_types ; manual update: mli only files asttypes parsetree
;; TYPING
;; TYPING
ident
path
jkind
Expand Down Expand Up @@ -893,7 +893,6 @@
; guess is that targets in subdirectories aren't even discovered until
; ocamlcommon is built, unless something in the subdirectory is explicitly made
; a dependency.

(alias
(name install)
(package ocaml)
Expand Down
23 changes: 0 additions & 23 deletions reorder.ml

This file was deleted.

29 changes: 11 additions & 18 deletions typing/typeopt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -592,20 +592,17 @@ and value_kind_mixed_block_field env ~loc ~visited ~depth ~num_nodes_visited
| Vec128 -> num_nodes_visited, Vec128
| Word -> num_nodes_visited, Word

and value_kind_mixed_block :
'a. _ -> loc:_ -> visited:_ -> depth:_ -> num_nodes_visited:_ -> shape:_
-> field_to_type:('a -> _) -> 'a list -> _
= fun env ~loc ~visited ~depth ~num_nodes_visited ~shape
~field_to_type fields ->
and value_kind_mixed_block
env ~loc ~visited ~depth ~num_nodes_visited ~shape types =
let (_, num_nodes_visited), shape =
List.fold_left_map
(fun (i, num_nodes_visited) field ->
(fun (i, num_nodes_visited) typ ->
let num_nodes_visited, kind =
value_kind_mixed_block_field env ~loc ~visited ~depth
~num_nodes_visited shape.(i) (field_to_type field)
~num_nodes_visited shape.(i) typ
in
(i+1, num_nodes_visited), kind)
(0, num_nodes_visited) fields
(0, num_nodes_visited) types
in
num_nodes_visited, Constructor_mixed (Array.of_list shape)

Expand Down Expand Up @@ -647,11 +644,6 @@ and value_kind_variant env ~loc ~visited ~depth ~num_nodes_visited
in
num_nodes_visited, Lambda.Constructor_uniform shape
in
let for_one_mixed_constructor fields ~shape ~field_to_type ~depth
~num_nodes_visited =
value_kind_mixed_block env ~loc ~visited ~depth ~num_nodes_visited
~shape ~field_to_type fields
in
let for_one_constructor (constructor : Types.constructor_declaration)
~depth ~num_nodes_visited
~(cstr_shape : Types.constructor_representation) =
Expand All @@ -665,8 +657,8 @@ and value_kind_variant env ~loc ~visited ~depth ~num_nodes_visited
for_one_uniform_value_constructor fields ~field_to_type
~depth ~num_nodes_visited
| Constructor_mixed shape ->
for_one_mixed_constructor fields
~shape ~field_to_type ~depth ~num_nodes_visited
value_kind_mixed_block env ~loc ~visited ~depth ~num_nodes_visited
~shape (List.map field_to_type fields)
in
(false, num_nodes_visited), fields
| Cstr_record labels ->
Expand All @@ -683,8 +675,8 @@ and value_kind_variant env ~loc ~visited ~depth ~num_nodes_visited
for_one_uniform_value_constructor labels ~field_to_type
~depth ~num_nodes_visited
| Constructor_mixed shape ->
for_one_mixed_constructor labels
~shape ~field_to_type ~depth ~num_nodes_visited
value_kind_mixed_block env ~loc ~visited ~depth ~num_nodes_visited
~shape (List.map field_to_type labels)
in
(is_mutable, num_nodes_visited), fields
in
Expand Down Expand Up @@ -796,8 +788,9 @@ and value_kind_record env ~loc ~visited ~depth ~num_nodes_visited
num_nodes_visited, Constructor_uniform fields
| Record_inlined (_, Constructor_mixed shape, _)
| Record_mixed shape ->
let types = List.map (fun label -> label.Types.ld_type) labels in
value_kind_mixed_block env ~loc ~visited ~depth ~num_nodes_visited
~shape ~field_to_type:(fun label -> label.Types.ld_type) labels
~shape types
in
let non_consts =
match rep with
Expand Down

0 comments on commit 39c0b0b

Please sign in to comment.