scalatags icon indicating copy to clipboard operation
scalatags copied to clipboard

Any reason to still allow unit fragments in scala 3?

Open benediktwerner opened this issue 2 years ago • 1 comments

In Scala 3, if without an else always evaluates to Unit. This means code like div(if (cond) h1("a"), ...) now never produces anything, even if the conditions is true, which has lead to a few silent issues when we transitioned to Scala 3 where stuff suddenly wasn't rendered anymore. Are there any other reasons to keep allowing units in templates? If not, it seems better to disallow this now to avoid mistakes like this?

benediktwerner avatar Nov 28 '22 18:11 benediktwerner