ocaml-sys / config.ml

conditional compilation via attributes for OCaml
Other
27 stars 4 forks source link

Support @@cfg in match cases #5

Closed leostera closed 3 months ago

leostera commented 8 months ago

Currently, this is unsupported:

let foo a =
  match a with
  | 0 -> "0"
  | 1 -> "1"
  [@@cfg (disable=true)]

And the expected behavior is that we can remove that match case with the annotation.

This is mostly important for having good support for conditional constructors and variants, so that we can disable in tandem the pattern matching branches for them.

KFoxder commented 8 months ago

I am planning to look at this during the week.

leostera commented 8 months ago

Sounds great! ✨ Let us know if we can help :) and feel free to open a draft PR if you want some early feedback. Thanks! 🙏🏼

KFoxder commented 6 months ago

@leostera I think we can close this now!