reasonml / reason

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

Fix attributes on patterns #2592

Closed jordwalke closed 4 years ago

jordwalke commented 4 years ago

We were not printing attributes on patterns in many cases, and we also printed attributes on named args incorrectly. This will fix the printing bug and also print attributes in many newly supported locations (patterns). In the future, we can support a sugar for attributes on named args, but right now they require as aliases.

(~argName as [@attr] argName) => .

An alternative sugar syntax for punned could be:

(~argName [@attr]) => .