Beware the footguns!
https://mareks-082.medium.com/dark-side-of-the-primary-const...
Let's just say they could have done a much better job on it. It feels rushed and haphazard for such a mature language.
https://mareks-082.medium.com/dark-side-of-the-primary-const...
Let's just say they could have done a much better job on it. It feels rushed and haphazard for such a mature language.
I think, as a feature, this is sort of the MVP. They could have done a better job of it by adding more to it (e.g. maybe allow the readonly modifier on the constructor properties). It's hard to imagine them being able to take anything away from primary constructors that would make it better.