Scalac rejects case classes such as:
@ case class A[T]
(console):1: case classes must have a parameter list; try 'case class A()' or 'case object A'
case class A[T]
^
Dotty currently accepts them. This can be confusing in pattern matching: it looks like pattern case A => is matching on instances of class A, but it's actually matching on the companion object.
Yes, we should emit the same error as scalac here.
@smarter can I give this a shot? If so, can you please assign it to me as well.
BTW, you should make sure that enum A { case B[C] } has the same treatment.
@LPTK should this be allowed?
enum A { case B }
@ashwinbhaskar yes, that's just a case _value_. You refer to it and match it as B, so there is no confusion here.
@OlivierBlanvillain can the fix be merged now?
Most helpful comment
@smarter can I give this a shot? If so, can you please assign it to me as well.