New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable nullability in TabPageCollectionEditor #11283
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11283 +/- ##
===================================================
+ Coverage 74.26878% 74.27250% +0.00371%
===================================================
Files 3025 3025
Lines 626861 626870 +9
Branches 46742 46744 +2
===================================================
+ Hits 465562 465592 +30
+ Misses 157959 157935 -24
- Partials 3340 3343 +3
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good 😁
src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/TabPageCollectionEditor.cs
Show resolved
Hide resolved
ee8d0d0
to
3807bcc
Compare
src/System.Windows.Forms.Design/src/System/ComponentModel/Design/CollectionEditor.cs
Outdated
Show resolved
Hide resolved
3807bcc
to
1e6e27d
Compare
object? o = TypeDescriptor.CreateInstance(host, itemType, argTypes: null, args: null); | ||
|
||
return o is null | ||
? throw new InvalidOperationException( | ||
string.Format( | ||
SR.CollectionEditorCreateInstanceError, | ||
nameof(IDesignerHost), | ||
nameof(TypeDescriptor), | ||
itemType.FullName)) | ||
: o; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using is {} obj
can more simpler
if (TypeDescriptor.CreateInstance(host, itemType, argTypes: null, args: null) is { } obj)
{
return obj;
}
throw new InvalidOperationException(
string.Format(
SR.CollectionEditorCreateInstanceError,
nameof(IDesignerHost),
nameof(TypeDescriptor),
itemType.FullName));
Proposed changes
Microsoft Reviewers: Open in CodeFlow