@@ -377,22 +377,32 @@ let pat ~(file : File.t) ~env ~extra (iter : Tast_iterator.iterator)
377377 | Tpackage (path , _ , _ ) -> Some path
378378 | _ -> None
379379 in
380- let addForPattern stamp name =
380+ let addForDeclaredPattern ~ stamp ~ name ~ extent ~ item ~ attributes =
381381 if Stamps. findValue file.stamps stamp = None then (
382382 let declared =
383383 ProcessAttributes. newDeclared ~name ~stamp ~module Path:NotVisible
384- ~extent: pattern.pat_loc ~item: pattern.pat_type false
385- pattern.pat_attributes
384+ ~extent ~item false attributes
386385 in
387386 Stamps. addValue file.stamps stamp declared;
388387 addReference ~extra stamp name.loc;
389388 addLocItem extra name.loc
390- (Typed (name.txt, pattern.pat_type, Definition (stamp, Value ))))
389+ (Typed (name.txt, item, Definition (stamp, Value ))))
390+ in
391+ let addForPattern stamp name =
392+ addForDeclaredPattern ~stamp ~name ~extent: pattern.pat_loc
393+ ~item: pattern.pat_type ~attributes: pattern.pat_attributes
391394 in
392395 (* Log.log("Entering pattern " ++ Utils.showLocation(pat_loc)); *)
393396 (match pattern.pat_desc with
394- | Tpat_record (items , _ , _rest ) ->
395- addForRecord ~env ~extra ~record Type:pattern.pat_type items
397+ | Tpat_record (items , _ , rest ) -> (
398+ addForRecord ~env ~extra ~record Type:pattern.pat_type items;
399+ match rest with
400+ | None -> ()
401+ | Some rest ->
402+ addForDeclaredPattern
403+ ~stamp: (Ident. binding_time rest.rest_ident)
404+ ~name: rest.rest_name ~extent: rest.rest_name.loc ~item: rest.rest_type
405+ ~attributes: pattern.pat_attributes)
396406 | Tpat_construct (lident , constructor , _ ) ->
397407 addForConstructor ~env ~extra pattern.pat_type lident constructor
398408 | Tpat_alias (_inner , ident , name ) -> (
0 commit comments