syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Formatter error related to ternary operator? "Did you forget a `:` here?"

Open vdanchenkov opened this issue 4 years ago • 2 comments

What we had in reasonml

let f = x => x ? () => () : (() => Js.log("no"));

After conversion to rescript if formats to:

let f = x => x ? () => () : () => Js.log("no")

Which does no compile with error "Did you forget a : here?"

vdanchenkov avatar Feb 08 '21 16:02 vdanchenkov

Thanks for the report! This is quite fishy. Investigating…

IwanKaramazow avatar Feb 08 '21 17:02 IwanKaramazow

Related, this snippet in ReScript gives a weird error:

Screen Shot 2021-02-26 at 8 58 40 PM

chenglou avatar Feb 27 '21 04:02 chenglou

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 23:05 stale[bot]