Reason: [refmt]: Operators precedence is not respected on line breaks

Created on 23 Jun 2018  路  1Comment  路  Source: reasonml/reason

/* Actual */
let isWithinWithOffset = (point: Point.t, rect: Rect.t, offset: Offset.t) =>
  point.x >= rect.left
  - offset.left
  && point.x <= rect.right
  + offset.right
  && point.y >= rect.top
  - offset.top
  && point.y <= rect.bottom
  + offset.bottom;

/* Expected */
let isWithinWithOffset = (point: Point.t, rect: Rect.t, offset: Offset.t) =>
  point.x >= rect.left - offset.left
  && point.x <= rect.right + offset.right
  && point.y >= rect.top - offset.top
  && point.y <= rect.bottom + offset.bottom;

If I try to prevent line break by wrapping (rect.left - offset.left), refmt removes ().

BUG Parser

Most helpful comment

I'll see what I can do in the second part of next week.

>All comments

I'll see what I can do in the second part of next week.

Was this page helpful?
0 / 5 - 0 ratings