reasonml / reason

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
http://reasonml.github.io
MIT License
10.08k stars 425 forks source link

Fix ppat_constraint case #2690

Closed SanderSpies closed 1 year ago

SanderSpies commented 1 year ago

Fixes issue 2636 where

let branch_with_variant_and_annotation =
  fun
  | (VariantType1: test_foo) => true
  | VariantType2 => false;

is printed as

let branch_with_variant_and_annotation =
  fun
  | VariantType1: test_foo => true
  | VariantType2 => false;

and fails to compile.

jordwalke commented 1 year ago

Thank you. Curious how this was introduced. I think the test failure is unrelated?

anmonteiro commented 1 year ago

Yup, CI failure is unrelated. Fix looks good to me. @davesnx please add these tests to your cram PR.

jordwalke commented 1 year ago

Thank you