Created
May 8, 2020 21:12
-
-
Save enisn/12925d252a183d5ebfcecdd73f7bd5a2 to your computer and use it in GitHub Desktop.
Nullcheck - Sample 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void DoSomething([NotNull]string message) // Does not affect anything at runtime. | |
| { | |
| } | |
| public void AnotherMethod() | |
| { | |
| DoSomething(null); // MsBuild doesn't allow to build. | |
| string parameter = null; | |
| DoSomething(parameter); // MsBuild allows build. But nothing happend at runtime. | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment