bUnit icon indicating copy to clipboard operation
bUnit copied to clipboard

fix some nullables

Open SimonCropp opened this issue 2 years ago • 2 comments

remove some redundant ? and !

SimonCropp avatar Jul 04 '22 01:07 SimonCropp

Looks like we have test failing after the these changes. Want to take another stab at it or should we close this PR?

I guess the tests are contradicting the actual (new) implementation. We have tests, which do things like: null! and those fail now. The only way to fix this is actually to remove those tests.... which to some extend make sense. On the one side we use non-nullable reference types, but on the other side in tests we basically do the opposite with null!. It is always a bit of an balancing act between: "Yes we have non-nullable reference types so we can outsource the problem to the user" VS "Our users might not have non-nullable reference types and they might get weird exceptions".

linkdotnet avatar Aug 04 '22 19:08 linkdotnet

I guess the tests are contradicting the actual (new) implementation. We have tests, which do things like: null! and those fail now. The only way to fix this is actually to remove those tests.... which to some extend make sense. On the one side we use non-nullable reference types, but on the other side in tests we basically do the opposite with null!. It is always a bit of an balancing act between: "Yes we have non-nullable reference types so we can outsource the problem to the user" VS "Our users might not have non-nullable reference types and they might get weird exceptions".

I think its important to test what even "stupid" users might do (aka those that ignore the compiler or turn of nullable ref types), so I do think the null! tests are valid.

egil avatar Aug 09 '22 10:08 egil

This looks like its dead, so ill close it for now.

egil avatar Oct 13 '22 11:10 egil