-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Given this input (a destructive substitution of a module-item):
module Frequency : Wrap.S with type u := int = struct
exception UnknownFrequency of int
type t =
| Daily
| Monthly
(* TODO: Right now billing only supports 3, 5, and 7. Fix this once billing is updated. *)
let wrap = function
| 1 -> Daily
| 30 -> Monthly
| n -> raise (UnknownFrequency n)
let unwrap = function
| Daily -> 1
| Monthly -> 30
end… Reanalyze v2.23.0 invoked with -write produces this (syntactically invalid, and also nonsensical in this case hahaha) output:
module Frequency : Wrap.S with type u := int [@@dead "Frequency.+unwrap"] = struct
exception UnknownFrequency of int
type t =
| Daily
| Monthly
(* TODO: Right now billing only supports 3, 5, and 7. Fix this once billing is updated. *)
let wrap = function
| 1 -> Daily
| 30 -> Monthly
| n -> raise (UnknownFrequency n) [@@dead "Frequency.+wrap"]
let unwrap = function
| Daily -> 1
| Monthly -> 30 [@@dead "Frequency.+unwrap"]
endNote that [@@dead "Frequency.+unwrap"] appears twice, in both the correct and nonsensical locations. A bug perhaps? (=
Similar issues when pattern-matching on a tuple:
let target, _group, filters = populate_mapping target group filters... becomes ...
let target, _group [@@dead "Mappings.+_group"] , filters = populate_mapping target group filtersAll told, -write dropped a few dozen syntax-errors across our codebase. Not the biggest deal, except I'm not sure how to correctly annotate these values so the next -write dosen't simply re-add them …
Metadata
Metadata
Assignees
Labels
No labels