Skip to content

Don't warn on unused record primary constructor parameters#47830

Merged
davidwengier merged 1 commit intodotnet:masterfrom
davidwengier:DontRemoveUnusedPrimaryConstructorParametrs
Sep 19, 2020
Merged

Don't warn on unused record primary constructor parameters#47830
davidwengier merged 1 commit intodotnet:masterfrom
davidwengier:DontRemoveUnusedPrimaryConstructorParametrs

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Sep 18, 2020

Fixes #47142
Fixes #47174

Until we synthesize operation blocks for implicit code this analyzer can't reason about records much, so just opt them out and don't confuse/annoy people.

FYI @jcouv

@mavasani mavasani added this to the 16.8.P4 milestone Sep 18, 2020
Copy link
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

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

Does this completely avoid checking records?

The analyzer should report in some cases. See #47666

@davidwengier
Copy link
Member Author

Does this completely avoid checking records?

Yes, for now that's the only option without rewriting the whole analyzer to not be operation based, which is why I logged #47829 and specifically linked to #47666 from it.

If the operation API is improved we'll essentially get #47666 for free.

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 1)

@davidwengier davidwengier merged commit 6e4a781 into dotnet:master Sep 19, 2020
@ghost ghost modified the milestones: 16.8.P4, Next Sep 19, 2020
@davidwengier davidwengier deleted the DontRemoveUnusedPrimaryConstructorParametrs branch September 20, 2020 00:41
@dibarbet dibarbet modified the milestones: Next, 16.8.P4 Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only base positional Record parameters shown as used Incorrect "Remove unused parameter" for record

5 participants