@@ -239714,26 +239714,41 @@ let rec moduleTypeCheckAnnotation ~checkAnnotation
239714
239714
->
239715
239715
false
239716
239716
239717
+ and moduleTypeDeclarationCheckAnnotation ~checkAnnotation
239718
+ ({ mtd_type; mtd_attributes; mtd_loc = loc } :
239719
+ Typedtree.module_type_declaration) =
239720
+ mtd_attributes |> checkAnnotation ~loc
239721
+ ||
239722
+ match mtd_type with
239723
+ | None -> false
239724
+ | Some module_type ->
239725
+ module_type |> moduleTypeCheckAnnotation ~checkAnnotation
239726
+
239717
239727
and moduleDeclarationCheckAnnotation ~checkAnnotation
239718
239728
({ md_attributes; md_type; md_loc = loc } : Typedtree.module_declaration) =
239719
239729
md_attributes |> checkAnnotation ~loc
239720
239730
|| md_type |> moduleTypeCheckAnnotation ~checkAnnotation
239721
239731
239722
239732
and signatureItemCheckAnnotation ~checkAnnotation
239723
239733
(signatureItem : Typedtree.signature_item) =
239724
- match signatureItem with
239725
- | { Typedtree.sig_desc = Typedtree. Tsig_type (_, typeDeclarations) } ->
239734
+ match signatureItem.sig_desc with
239735
+ | Tsig_type (_, typeDeclarations) ->
239726
239736
typeDeclarations
239727
239737
|> List.exists
239728
239738
(fun ({ typ_attributes; typ_loc = loc } : Typedtree.type_declaration)
239729
239739
-> typ_attributes |> checkAnnotation ~loc)
239730
- | { sig_desc = Tsig_value { val_attributes; val_loc = loc } } ->
239740
+ | Tsig_value { val_attributes; val_loc = loc } ->
239731
239741
val_attributes |> checkAnnotation ~loc
239732
- | { sig_desc = Tsig_module moduleDeclaration } ->
239742
+ | Tsig_module moduleDeclaration ->
239733
239743
moduleDeclaration |> moduleDeclarationCheckAnnotation ~checkAnnotation
239734
- | { sig_desc = Tsig_attribute attribute; sig_loc = loc } ->
239735
- [ attribute ] |> checkAnnotation ~loc
239736
- | _ -> false
239744
+ | Tsig_attribute attribute ->
239745
+ [ attribute ] |> checkAnnotation ~loc:signatureItem.sig_loc
239746
+ | Tsig_modtype moduleTypeDeclaration ->
239747
+ moduleTypeDeclaration
239748
+ |> moduleTypeDeclarationCheckAnnotation ~checkAnnotation
239749
+ | Tsig_typext _ | Tsig_exception _ | Tsig_recmodule _ | Tsig_open _
239750
+ | Tsig_include _ | Tsig_class _ | Tsig_class_type _ ->
239751
+ false
239737
239752
239738
239753
and signatureCheckAnnotation ~checkAnnotation (signature : Typedtree.signature)
239739
239754
=
@@ -239742,28 +239757,35 @@ and signatureCheckAnnotation ~checkAnnotation (signature : Typedtree.signature)
239742
239757
239743
239758
let rec structureItemCheckAnnotation ~checkAnnotation
239744
239759
(structureItem : Typedtree.structure_item) =
239745
- match structureItem with
239746
- | { Typedtree.str_desc = Typedtree. Tstr_type (_, typeDeclarations) } ->
239760
+ match structureItem.str_desc with
239761
+ | Tstr_type (_, typeDeclarations) ->
239747
239762
typeDeclarations
239748
239763
|> List.exists
239749
239764
(fun ({ typ_attributes; typ_loc = loc } : Typedtree.type_declaration)
239750
239765
-> typ_attributes |> checkAnnotation ~loc)
239751
- | { str_desc = Tstr_value (_loc, valueBindings) } ->
239766
+ | Tstr_value (_loc, valueBindings) ->
239752
239767
valueBindings
239753
239768
|> List.exists
239754
239769
(fun ({ vb_attributes; vb_loc = loc } : Typedtree.value_binding) ->
239755
239770
vb_attributes |> checkAnnotation ~loc)
239756
- | { str_desc = Tstr_primitive { val_attributes; val_loc = loc } } ->
239771
+ | Tstr_primitive { val_attributes; val_loc = loc } ->
239757
239772
val_attributes |> checkAnnotation ~loc
239758
- | { str_desc = Tstr_module moduleBinding } ->
239773
+ | Tstr_module moduleBinding ->
239759
239774
moduleBinding |> moduleBindingCheckAnnotation ~checkAnnotation
239760
- | { str_desc = Tstr_recmodule moduleBindings } ->
239775
+ | Tstr_recmodule moduleBindings ->
239761
239776
moduleBindings
239762
239777
|> List.exists (moduleBindingCheckAnnotation ~checkAnnotation)
239763
- | { str_desc = Tstr_include { incl_attributes; incl_mod; incl_loc = loc } } ->
239778
+ | Tstr_include { incl_attributes; incl_mod; incl_loc = loc } ->
239764
239779
incl_attributes |> checkAnnotation ~loc
239765
239780
|| incl_mod |> moduleExprCheckAnnotation ~checkAnnotation
239766
- | _ -> false
239781
+ | Tstr_modtype moduleTypeDeclaration ->
239782
+ moduleTypeDeclaration
239783
+ |> moduleTypeDeclarationCheckAnnotation ~checkAnnotation
239784
+ | Tstr_attribute attribute ->
239785
+ [ attribute ] |> checkAnnotation ~loc:structureItem.str_loc
239786
+ | Tstr_eval _ | Tstr_typext _ | Tstr_exception _ | Tstr_open _ | Tstr_class _
239787
+ | Tstr_class_type _ ->
239788
+ false
239767
239789
239768
239790
and moduleExprCheckAnnotation ~checkAnnotation
239769
239791
(moduleExpr : Typedtree.module_expr) =
0 commit comments