Why were the case classes without a parameter list deprecated from Scala? And why does compiler suggest to use () as parameter list instead?
EDIT :
Someone please answer my second question… 😐
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is really easy to accidentally use a no-arg case class incorrectly as a pattern.
Instead of:
Or better:
UPDATE Hopefully the transcript below will demonstrate why an empty parameter list is preferred to the deprecated missing parameter list.
A case object would usually still be preferred over an empty parameter list.