Skip to content

ppx_devtools.optcomp: gate type declarations and constructors - #1

Merged
vouillon merged 2 commits into
mainfrom
optcomp-type-gating
Oct 27, 2026
Merged

vouillon merged 2 commits into
mainfrom
optcomp-type-gating

Conversation

@vouillon

Copy link
Copy Markdown
Member

@@if can now be placed on type declarations (in structures and signatures), and @if on variant constructors and extension constructors. Together with the existing support for gated match patterns, this makes it possible to define a constructor only on some configurations. A type extension whose constructors are all gated out is dropped.

@hhugo

hhugo commented Oct 27, 2026

Copy link
Copy Markdown
Member

@vouillon, I'll let you rebase and merge

vouillon and others added 2 commits October 27, 2026 14:50
[@@if] can now be placed on type declarations (in structures and
signatures), and [@if] on variant constructors and extension
constructors. Together with the existing support for gated match
patterns, this makes it possible to define a constructor only on some
configurations. A type extension whose constructors are all gated out
is dropped.
With OxCaml's ppxlib, gated patterns are not filtered in the cases of
a function, so use a match instead in the test for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hhugo
hhugo force-pushed the optcomp-type-gating branch from 9d2c977 to 7770a2b Compare October 27, 2026 13:54
@vouillon
vouillon merged commit 96f0fe0 into main Oct 27, 2026
13 checks passed
@vouillon
vouillon deleted the optcomp-type-gating branch October 27, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants