Skip to content
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

Fix 'use primary constructor' in the presence of directives #68612

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 14, 2023 15:44
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 14, 2023
@@ -381,12 +379,17 @@ void RegisterFieldOrPropertyAnalysisIfNecessary(Analyzer? analyzer)
Dictionary<ISymbol, IParameterSymbol> candidateMembersToRemove)
{
var semanticModel = compilation.GetSemanticModel(primaryConstructorDeclaration.SyntaxTree);

var body = primaryConstructorDeclaration.ExpressionBody ?? (SyntaxNode?)primaryConstructorDeclaration.Body;
if (body?.ContainsDirectives is true)
Copy link
Contributor

@mavasani mavasani Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this also turn off the diagnostic in presence of pragma directives? Is that desirable? Not a big deal either way though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably. but we can see if that's a big enough negative if people have an issue with it.

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge June 14, 2023 16:12
@CyrusNajmabadi CyrusNajmabadi merged commit 10c6d36 into dotnet:main Jun 14, 2023
@ghost ghost added this to the Next milestone Jun 14, 2023
@CyrusNajmabadi CyrusNajmabadi deleted the usePrimaryDirectives branch June 14, 2023 17:06
@RikkiGibson RikkiGibson modified the milestones: Next, 17.7 P3 Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants