[m-rev.] for post-commit review: new pragma type_order_switch

Julien Fischer jfischer at opturion.com
Wed Jun 18 15:01:10 AEST 2025


On Tue, 17 Jun 2025 at 23:35, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
>
> I intend to use this new pragma to ensure that the order
> of the clauses of the optdb predicate matches the order
> of the options they describe in the option type.
>
> The implementation is straightforward, and thus does not
> really need review. The questions I would like reviewers
> to look at are:
>
> Is this pragma useful generally enough to be publicly documented?

I think so.  Would it be more useful as a scope around a switch, rather
than a pragma on the predicate. (We already have a bunch of such scopes.)

> Can anyone think of a better name for the pragma?

In line with other pragmas / scopes, it probably wants to be
"require_" something.
Perhaps, "require_switch_type_order"?

> Can anyone think of any way to improve the wording of the
> warning message?

Not so much an improvement, but don't we refer to "cases" as "arms"
elsewhere?

Julien.


More information about the reviews mailing list