Also, the developer may not own the function so that would not provide a good solution. This is where someone would bring up contracts, but this feature is still experimental which some code bases will not allow. Since myInput is a nullable type, even though we check in the isInputValid function and assert that myInput is not null, the compiler cannot confidently state that myInput is no longer null in the scope of that if statement and will not compile.
0 Comments
Leave a Reply. |