[Class] Enable nullability + fix a few code updates. - #13281
Conversation
rolfbjarne
commented
Nov 4, 2021
- Enable nullability and fix code accordingly.
- Use 'is' and 'is not' instead of '==' and '!=' for object identity.
- Use 'nameof (parameter)' instead of string constants.
- Make the 'handle' field private.
- Remove the (IntPtr) constructor for .NET
- Make the (IntPtr, bool) constructor internal for .NET
- Remove unused 'Construct' method.
* Enable nullability and fix code accordingly. * Use 'is' and 'is not' instead of '==' and '!=' for object identity. * Use 'nameof (parameter)' instead of string constants. * Make the 'handle' field private. * Remove the (IntPtr) constructor for .NET * Make the (IntPtr, bool) constructor internal for .NET * Remove unused 'Construct' method.
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffView dotnet API diffView dotnet legacy API diffAPI & Generator diffℹ️ API Diff (from PR only) (please review changes) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results6 tests failed, 93 tests passed.Failed tests
Pipeline on Agent XAMBOT-1094.BigSur' |
It'll be the only way to create a Class instance given an IntPtr.
❌ [CI Build] Tests didn't execute on Build. ❌Tests didn't execute on Build. No test summary was found (something probably failed before the tests could execute) |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffView dotnet API diffView dotnet legacy API diffAPI & Generator diffℹ️ API Diff (from PR only) (please review changes) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results7 tests failed, 92 tests passed.Failed tests
Pipeline on Agent XAMBOT-1094.BigSur' |
|
Test failures are unrelated:
Build is currently broken in main, waiting to merge until that's fixed (#13304). |
The split [1] was done to ease nullability annotations since there's no syntax to cover this specific case with custom attributes. However we don't need three methods for the split. Two are enough :) [1] dotnet#13281
That was mentioned > Remove the (IntPtr) constructor for .NET inside dotnet#13281 but not actually done inside that PR
That was mentioned > Remove the (IntPtr) constructor for .NET inside #13281 but not actually done inside that PR