Skip to content

Bug: break-separators=after-and-docked doesn't affect let bindings #967

@Wilfred

Description

@Wilfred
type t =
  { hash: hash_type;
    file_mode: mode option;
    funs: id list;
    classes: id list;
    typedefs: id list;
    consts: id list;
    comments: (Pos.t * comment) list option }

let empty_t =
  { hash= None;
    file_mode= None;
    funs= [];
    classes= [];
    typedefs= [];
    consts= [];
    comments= Some [] }

Produces:

$ ocamlformat --break-separators=after-and-docked demo1.ml
type t = {
  hash: hash_type;
  file_mode: mode option;
  funs: id list;
  classes: id list;
  typedefs: id list;
  consts: id list;
  comments: (Pos.t * comment) list option;
}

let empty_t =
  {
    hash= None;
    file_mode= None;
    funs= [];
    classes= [];
    typedefs= [];
    consts= [];
    comments= Some [];
  }

This is inconsistent with the other values of break-separators, which do affect type definitions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions