scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.88k stars 1.06k forks source link

Weird error message when using Unit as a value #20357

Closed scf37 closed 6 months ago

scf37 commented 6 months ago

Compiler version

3.4.1

Minimized code

val x = Unit

Output

Reference to object Unit in package scala should not have survived,
it should have been processed and eliminated during expansion of an enclosing macro or term erasure.

Expectation

Scala 2.13.14:

`Unit` companion object is not allowed in source; instead, use `()` for the unit value
som-snytt commented 6 months ago

Duplicates https://github.com/scala/scala3/issues/17515