Compiler wrongly identify value classes during desugaring (dual of #21918) #21943
Labels
area:desugar
Desugaring happens after parsing but before typing, see desugar.scala
area:value-classes
Issues tied to value classes.
itype:bug
Spree
Suitable for a future Spree
Compiler version
bed0e86
Minimized code
Output
During
typer
, the desugaring assumes we are implementing a value class and generates the companion object forFoo
Expectation
Should behave the same way as extending any other reference class:
## Note
This is has the same root problem as #21918. In #21918, it was a case where
isAnyVal
wrongly unidentify value classes (false negative) while this issue is the case where the same check wrongly identify value classes (false positive).scala3/compiler/src/dotty/tools/dotc/ast/Desugar.scala
Lines 597 to 601 in cc38962
The text was updated successfully, but these errors were encountered: