-
Notifications
You must be signed in to change notification settings - Fork 729
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
Ignore statics in metric source-gen #4843
Conversation
@@ -1,11 +1,10 @@ | |||
// Licensed to the .NET Foundation under one or more agreements. | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
|
|||
#if false |
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.
Previously these tests were completely disabled 😕
@@ -96,27 +96,6 @@ class Transitive | |||
Assert.Contains("Test.Transitive ⇆ Test.Interim", diag.GetMessage()); | |||
} | |||
|
|||
[Fact] | |||
public async Task StrongTypeCounter_CyclicReference_Guid() |
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 test is not relevant anymore - we don't consider Guid.Empty
since it's static
@@ -688,23 +686,24 @@ private void Diag(DiagnosticDescriptor desc, Location? location, params object?[ | |||
SpecialType specialType; | |||
ITypeSymbol typeSymbol; | |||
|
|||
if (symbol.IsImplicitlyDeclared) | |||
if (member.IsImplicitlyDeclared || | |||
member.IsStatic) |
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 the main change
Fixes #4787
This PR also enables and aligns all metering tests for generated code.
Microsoft Reviewers: Open in CodeFlow