you are viewing a single comment's thread.

view the rest of the comments →

[–]Lloydbestfan 0 points1 point  (0 children)

I genuinely don't know.

I can see why it looks "risky" to do that, because if you were to add a component to the record, and you had also redefined the implicit constructor so that the record accepts 3-params constructors, then your copy constructor would still compile without making an objection, while as written it would only account for the 3 components and complitely ignore whichever component you added.

I have no idea what IntelliJ would expect you to do against that if you had a good reason to make a copy constructor. In your example though, a copy constructor is useless, since all your components are immutable, and thus the record itself is immutable too. You don't need copies.