Conversation
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
| public DataGridViewTopRowAccessibleObject() | ||
| { | ||
| } |
There was a problem hiding this comment.
Can we also remove the parameterless constructor?
|
It's safe to remove
The only question whether we want be explicit about calling base parameterless constructors or not (and can we enforce it through code style rules in Roslyn). cc: @RussKie |
|
The default .ctors are called implicitly if those are present and no other .ctor is explicitly called. |
RussKie
left a comment
There was a problem hiding this comment.
once the comment is addressed.
2383799
2383799 to
69a6939
Compare
I mean is there a code style rule that will warn when the base parameterless .ctor is called explicitly? (to avoid this in future) |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
The compiler will tell you :) If there is no .ctor defined - one is implicitly added and called. If there is a non-default .ctor (i.e. with parameters) - it will always be called, no default .ctor will be generated. |
| System.Windows.Forms.DataGridView.DataGridViewAccessibleObject.DataGridViewAccessibleObject(System.Windows.Forms.DataGridView! owner) -> void | ||
| System.Windows.Forms.DataGridView.DataGridViewControlCollection | ||
| System.Windows.Forms.DataGridView.DataGridViewTopRowAccessibleObject | ||
| System.Windows.Forms.DataGridView.DataGridViewTopRowAccessibleObject.DataGridViewTopRowAccessibleObject() -> void |
There was a problem hiding this comment.
We must not alter the public API surface. See https://docs.microsoft.com/dotnet/api/system.windows.forms.datagridview.datagridviewtoprowaccessibleobject.-ctor
There was a problem hiding this comment.
Ok, restored paramless ctor and tis file. Thanks
This is what I actually meant (code style rule, not the code generation): And as I can see there is no rule for that :( |
69a6939 to
df4f7b4
Compare
|
Hello @RussKie! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Resolve comment from pr #6432
Proposed changes
Customer Impact
Regression?
Risk
Microsoft Reviewers: Open in CodeFlow