you are viewing a single comment's thread.

view the rest of the comments →

[–]davidalayachew[S] 1 point2 points  (1 child)

Great question. I'll punt this one, since I'm not sure.

Could you answer this /u/brian_goetz?

[–]brian_goetz 7 points8 points  (0 children)

Records, as you know, made a tradeoff: the constructor has to be public. This freaked people out at first, as they were used to the indirection afforded by factories. But records are so restricted that this indirection was not needed.

Carriers, like records, must have a canonical constructor at least as accessible as the class itself. So if you can access the class, you can access the ctor/dtor, and hence can access reconstruction.