-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Moving CS8618 'Non-nullable field is uninitialized' to the construction place #2411
Comments
@alexk8 This has nothing to to with the proposal at all, however, I have to say, that your profile picture gave my sleep-depraved brain quite a start! good one! |
Only because the warning is in the wrong place. Proposing to fix that by putting a new keyword into the language like this has an absurdly high bar, whereas the linked proposal would solve the same problem at a much lower cost and that is more in-line with the design of NRTs. |
Agree, but NRTs concept does introduce lots of new magic, doesn't it? Let's say that's separete, quite crazy proposal, but why not? Of course "deserializaton" can be done totaly by reflection, The only thing I'd like to have is null-checks after runtime weak construction, in more optimal and strightforward way - compiler generated. This probably does not require keyword itself, some other magic may happen in compiletime, it needs only a hint to do that. Somebody may invent other way, I've just shown my general idea.
|
However, I agree that this "deserialization" stuff is not really needed. The main problem is:
|
closing this issue in favour of 2328 |
I've decided to reopen the issue just to ask - Is it even possible to move the warning to the construction side, by default? |
Found more similar #2109 |
This warning is something bad by design,
it fits badly into deserialization concept which is used everywhere! (json,EF,ORM,Mappers,etc)
I suggest that it's caller's responsibility to construct object properly,
I'd like to see something like this:
*** EDITED ***
some other crazy ideas:
The text was updated successfully, but these errors were encountered: