A question about newline char in Rescript 10

Hello the ReScript team :wave:

A big thank you for the huge work done these last months on the language. It’s a real pleasure to use ReScript in production every day.
While upgrading to rescript@v10, we noticed a problem with the newline character :

let a = "\n" ++ "\n"

compiles to

// v9.1.2
var a = "\n\n";

// v10.0.1
var a = "\\n\\n";

You can see it in the following playground link : https://rescript-lang.org/try?code=DYUwLgBAhhC8ECIA6A7BEDUHGoUA
Is this a bug or is it intentional (=known breaking change) ?

The following is ok (=compilation works) :

let a = "\n\n"
let b = `\n\n`

let c = "\n"
let d = "\n"
let e = `${c}${d}`

Tell me if I should add the issue in the rescript-compiler

I thank you for your help


Could you try with rescript@next? Pretty sure this is fixed in 10.1, that’s just around the corner.

1 Like

I tested with rescript@next and it works great ! :tada:

1 Like