paul1956 / CSharpToVB

New version of CSharpToVB converter
MIT License
25 stars 9 forks source link

Nullable Reference Types #57

Closed DualBrain closed 3 years ago

DualBrain commented 3 years ago

Are you able to "automate" the removal of the ? from the conversion for reference types? When removed, add a TODO: comment stating that the original source declared the variable as a Nullable Reference Type and additional code review may be necessary to handle null conditions.

paul1956 commented 3 years ago

@DualBrain I just added that for strings this week, I was afraid to do others. I can do it for all the predefined types very easily. Let me know.

DualBrain commented 3 years ago

As long as they are reference types, I'm assuming that they could be addressed in the same manner. Obviously there are valid places (non-reference types) where the ? is still valid... Integer, Short, Boolean, etc. With that said, the two places where I've run into this most often (so far) are String and Object.

paul1956 commented 3 years ago

I think I removed it from String this week if I missed a place please upload an example in the PR. Adding Object would be easy but an example would help, I just add to Tests and make sure I get the expected result.

paul1956 commented 3 years ago

@DualBrain please post an example and what you want it to be, latest release should handle String so if you have an example that don't work please post.

paul1956 commented 3 years ago

I found several places I was not removing the ? and not add (), they should be fixed in next PR.

paul1956 commented 3 years ago

@DualBrain should be fixed in Converter 5.0.0.19, reopen with example if you are still having an issue

DualBrain commented 3 years ago

reopen with example if you are still having an issue

Will do.