@@ -241,7 +241,7 @@ module Make (FA : Features.T) = struct
241241 sub_pat = Option. map ~f: (fun (p , _ ) -> dpat p) subpat;
242242 }
243243
244- and dspan ( _span : span ) : B.span = EmptyStructspan2
244+ and dspan : span -> B.span = Span. to_span2
245245
246246 and dbinding_mode (binding_mode : A.binding_mode ) : B.binding_mode =
247247 match binding_mode with
@@ -458,12 +458,8 @@ module Make (FA : Features.T) = struct
458458 {
459459 attributes = List. map ~f: dattr p.attrs;
460460 pat = dpat p.pat;
461- ty =
462- {
463- ty = dty p.typ;
464- span =
465- EmptyStructspan2 (* Should use dspan, but what if option is None*) ;
466- };
461+ ty = dty p.typ;
462+ ty_span = Option. map ~f: dspan p.typ_span;
467463 }
468464
469465 let dvariant (v : A.variant ) : B.variant =
@@ -513,7 +509,7 @@ module Make (FA : Features.T) = struct
513509 meta = dmetadata ~attrs: ii.ii_attrs ii.ii_span;
514510 }
515511
516- let ditem' (item : A.item' ) : B.item_kind =
512+ let ditem' (item : A.item' ) ( span : Types.span2 ) : B.item_kind =
517513 match item with
518514 | A. Fn { name; generics; body; params; safety } ->
519515 B. Fn
@@ -578,7 +574,7 @@ module Make (FA : Features.T) = struct
578574 | A. HaxError s ->
579575 let node : Types.fragment = Unknown " HaxError" in
580576 let info : B.diagnostic_info =
581- { context = Import ; kind = Custom s; span = EmptyStructspan2 }
577+ { context = Import ; kind = Custom s; span }
582578 in
583579 Error { node; info }
584580 | A. NotImplementedYet -> B. NotImplementedYet
@@ -587,7 +583,7 @@ module Make (FA : Features.T) = struct
587583 [
588584 {
589585 ident = dconcrete_ident i.ident;
590- kind = ditem' i.v;
586+ kind = ditem' i.v (dspan i.span) ;
591587 meta = dmetadata ~attrs: i.attrs i.span;
592588 };
593589 ]
0 commit comments