Closed
Description
Compiler version
3.2.1
Minimized code
//> using lib "org.scala-lang.modules::scala-xml:2.1.0"
@main def Test() = {
val elem = if(true) {
<script type="text/javascript">
'location.reload()'
'foo bar'
</script>
} else <div>empty</div>
println(elem)
}
Replacing parentheses with new if/then syntax allows to compile this code
// works with both `if true then ...` and `if true then { ...`
//> using lib "org.scala-lang.modules::scala-xml:2.1.0"
@main def Test() = {
val elem = if true then {
<script type="text/javascript">
'location.reload()'
'foo bar'
</script>
} else <div>empty</div>
println(elem)
}
Output
[error] ./test.sc:7:25: unclosed character literal
[error] 'location.reload()'
[error]
[error] ./test.sc:8:15: unclosed character literal
[error] 'foo bar'
[error]
Expectation
Should compile with output:
<script type="text/javascript">
'location.reload()'
</script>