Skip to content

Report warning for differences in parameter names in partial method declaration and implementation#47841

Closed
Youssef1313 wants to merge 1 commit intodotnet:mainfrom
Youssef1313:patch-12
Closed

Report warning for differences in parameter names in partial method declaration and implementation#47841
Youssef1313 wants to merge 1 commit intodotnet:mainfrom
Youssef1313:patch-12

Conversation

@Youssef1313
Copy link
Member

Fixes #47838

@Youssef1313 Youssef1313 requested a review from a team as a code owner September 18, 2020 17:51
@cston
Copy link
Contributor

cston commented Sep 18, 2020

Thanks @Youssef1313. Please hold off on this for now until we confirm with C# Language Design that we want to warn for differences in parameter names.

@cston
Copy link
Contributor

cston commented Sep 21, 2020

@Youssef1313, confirmed, we should warn for differences in parameter names or type parameter names.

We should use the same warning used for type differences, WRN_PartialMethodTypeDifference, updated to mention names in addition to types.

Perhaps the text of the combined warning should say:
"Partial method declarations '{0}' and '{1}' should have identical return types, parameter types, parameter names, and type parameter names."

Please feel free to proceed after warning WRN_PartialMethodTypeDifference has been added to the 16.9 warning wave.

@Youssef1313
Copy link
Member Author

@cston Thanks for confirming this.

I'll wait until WRN_PartialMethodTypeDifference is added again, then update its message and add tests.

In the meanwhile, I'll mark as a draft until WRN_PartialMethodTypeDifference is added again.

@Youssef1313 Youssef1313 marked this pull request as draft September 21, 2020 19:26
Base automatically changed from master to main March 3, 2021 23:52
@Youssef1313
Copy link
Member Author

@cston Any updates on this?

Please feel free to proceed after warning WRN_PartialMethodTypeDifference has been added to the 16.9 warning wave.

Looks like this had slipped from 16.9?
#47879 (comment) should have been re-reverted.

@Youssef1313
Copy link
Member Author

Replaced by #53352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report warning for differences in parameter names in partial method declaration and implementation

3 participants