syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Pipe first has higher priority than `!`

Open bloodyowl opened this issue 5 years ago • 5 comments

let a = "foo"
let x = !a->Js.String.includes("f") // doesn't compile (a should be a bool)
let x = !(a->Js.String.includes("f")) // compiles

That seems like a regression from the original syntax

bloodyowl avatar Dec 09 '20 07:12 bloodyowl

Yes, this is currently the case. I'll look into this.

IwanKaramazow avatar Dec 11 '20 07:12 IwanKaramazow

Same goes for object access:

let timezone = Intl.DateTimeFormat.make()->Intl.DateTimeFormat.resolvedOptions["timeZone"]

bloodyowl avatar Feb 27 '21 15:02 bloodyowl

Still on my TODO-list 😅

IwanKaramazow avatar Feb 28 '21 13:02 IwanKaramazow

According to the language, which operator should have more preference? -> (or) ! ?

a-c-sreedhar-reddy avatar Jul 11 '22 17:07 a-c-sreedhar-reddy

@ryyppy @cristianoc @IwanKaramazow

OCaml throws an error image

a-c-sreedhar-reddy avatar Jul 23 '22 10:07 a-c-sreedhar-reddy

The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

stale[bot] avatar May 28 '23 15:05 stale[bot]