reasonml / reason

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

refmt prints invalid Reason code for annotated polymorphic variant values when parsing OCaml syntax #2017

Closed hcarty closed 6 years ago

hcarty commented 6 years ago
$ echo 'let x : t = `Poly' | refmt --parse=ml
let x:  .t = (`Poly: t);

The type constraint is duplicated and gets a leading . on the lhs of the =, leading to invalid syntax. Reason 3.2.0 installed via opam.

IwanKaramazow commented 6 years ago

Hmm, this a serious bug. I'm fixing it, unacceptable.

hcarty commented 6 years ago

Thanks @iwankaramazow!