-
Notifications
You must be signed in to change notification settings - Fork 468
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
Bump code style package to 3.9.0 #4919
Conversation
e07d20a
to
f66766a
Compare
@@ -354,7 +354,7 @@ private static bool IsOnObsoleteMemberChain(ISymbol symbol, WellKnownTypeProvide | |||
while (symbol != null) | |||
{ | |||
allAttributes.AddRange(symbol.GetAttributes()); | |||
symbol = symbol is IMethodSymbol method && method.AssociatedSymbol != null | |||
symbol = symbol is IMethodSymbol { AssociatedSymbol: not null } method |
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.
This is a manual change. The codefix produces invalid code.
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.
Has the bug been filed?
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.
Oh, this is dotnet/roslyn#51691.
} | ||
else if (type is INamedTypeSymbol namedTypeSymbol | ||
&& namedTypeSymbol.EnumUnderlyingType != null) | ||
else if (type is INamedTypeSymbol { EnumUnderlyingType: not null } namedTypeSymbol) |
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.
This is a manual change. The codefix produces invalid code.
Have we also updated the getting started guide to indicate that VS 16.9+ is required? |
@@ -84,7 +84,9 @@ public override void Initialize(AnalysisContext context) | |||
} | |||
|
|||
static bool IsDelegateTypeWithInvokeMethod(INamedTypeSymbol namedType) => | |||
#pragma warning disable IDE0078 // Use pattern matching - https://github.com/dotnet/roslyn/issues/51691 | |||
namedType.TypeKind == TypeKind.Delegate && namedType.DelegateInvokeMethod != null; |
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.
❔ Is this not the same?
namedType.TypeKind == TypeKind.Delegate && namedType.DelegateInvokeMethod != null; | |
namedType is { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: not null }; |
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.
@sharwell There are actually more IDE0078 violations than the ones I suppressed. Some of them are actionable like you suggested, and others doesn't seem to be actionable. I'm thinking of setting the rule to silent for now until the analyzer and codefix bugs are fixed to avoid the many suppressions and manual fixes. Would you be okay with that?
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.
Certainly
@@ -193,7 +193,9 @@ public static ImmutableArray<IOperation> GetTopmostExplicitDescendants(this IOpe | |||
/// </summary> | |||
public static bool IsOperationNoneRoot(this IOperation operation) | |||
{ | |||
#pragma warning disable IDE0078 // Use pattern matching - https://github.com/dotnet/roslyn/issues/51691 | |||
return operation.Kind == OperationKind.None && operation.Parent == null; |
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.
💭
return operation.Kind == OperationKind.None && operation.Parent == null; | |
return operation is { Kind: OperationKind.None, Parent: null }; |
This reverts commit 68b9d1f.
Codecov Report
@@ Coverage Diff @@
## main #4919 +/- ##
==========================================
- Coverage 95.57% 95.54% -0.04%
==========================================
Files 1185 1198 +13
Lines 271566 274801 +3235
Branches 16427 16735 +308
==========================================
+ Hits 259561 262549 +2988
- Misses 9866 10092 +226
- Partials 2139 2160 +21 |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #4659