Skip to content

Value constraint pattern parens#2913

Open
davesnx wants to merge 6 commits intomasterfrom
value-constraint-pattern-parens
Open

Value constraint pattern parens#2913
davesnx wants to merge 6 commits intomasterfrom
value-constraint-pattern-parens

Conversation

@davesnx
Copy link
Member

@davesnx davesnx commented Mar 4, 2026

let x: t = x;
let (x as y): t = x;
let ((x, y) as pair): t = x;
let (Some(x) as opt): t = opt;
let ({url, mode} as target): t = x;
let ({url, mode, protocol} as target): TargetT.Safe.t =
  multiTarget->MultiTargetT.toIgnorableTargetT;
let ({url, mode}): t = x;

It generate syntactically wrong code:

let x: t = x;
let x as y: t = x;
let (x, y) as pair: t = x;
let Some(x) as opt: t = opt;
let { url, mode } as target: t = x;
let { url, mode, protocol } as target: TargetT.Safe.t =
  multiTarget->MultiTargetT.toIgnorableTargetT;
let { url, mode }: t = x;

https://melange.re/unstable/playground/?language=Reason&code=bGV0IHg6IHQgPSB4OwpsZXQgKHggYXMgeSk6IHQgPSB4OwpsZXQgKCh4LCB5KSBhcyBwYWlyKTogdCA9IHg7CmxldCAoU29tZSh4KSBhcyBvcHQpOiB0ID0gb3B0OwpsZXQgKHt1cmwsIG1vZGV9IGFzIHRhcmdldCk6IHQgPSB4OwpsZXQgKHt1cmwsIG1vZGUsIHByb3RvY29sfSBhcyB0YXJnZXQpOiBUYXJnZXRULlNhZmUudCA9CiAgbXVsdGlUYXJnZXQtPk11bHRpVGFyZ2V0VC50b0lnbm9yYWJsZVRhcmdldFQ7CmxldCAoe3VybCwgbW9kZX0pOiB0ID0geDs%3D&live=on

This PR ensures that if there's an alias, we wrap in parens

@davesnx davesnx force-pushed the value-constraint-pattern-parens branch from 8b2f66e to b7f15b0 Compare March 4, 2026 11:35
davesnx and others added 2 commits March 5, 2026 10:28
* test(rtop): capture stderr in integration test for Windows

* ci: setup tmate

* test(rtop): avoid running rtop in windows 4.14.*

* ci: enable 5.4.0 in windows

* ci: remove action-tmate

* ci: revert all changes, keep building

* ci: add -preasonrtop in esy-ci

* ci: update cache keys

* ci: fix Windows CI failures

- Disable rtopIntegration test on Windows due to lambda-term segfault
  when stdout is not a real console handle (ConPTY issue on GH Actions).
  See: ocaml-community/lambda-term#125

- Add setup-mingw step in esy-ci for Windows to provide x86_64-w64-mingw32-gcc
  needed to compile lambda-term C stubs.

- Bump esy cache keys to v0.0.2 to avoid stale caches.

* ci: replace setup-mingw action with direct choco install

The egor-tensin/setup-mingw@v2 action fails on MinGW 15.2.0 because
its cleanup script tries to remove libpthread.dll.a which no longer
exists in UCRT-based builds. Use choco directly and add the bin
directory to PATH manually.

* ci: esy-ci doesn't run rtop tests on windows
@davesnx davesnx requested a review from anmonteiro March 5, 2026 12:54
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.

1 participant