Skip to content

Report Obsolete diagnostics on operators involved in tuple equality#27178

Merged
jcouv merged 1 commit intodotnet:masterfrom
jcouv:obsolete-bug
May 30, 2018
Merged

Report Obsolete diagnostics on operators involved in tuple equality#27178
jcouv merged 1 commit intodotnet:masterfrom
jcouv:obsolete-bug

Conversation

@jcouv
Copy link
Copy Markdown
Member

@jcouv jcouv commented May 26, 2018

Customer scenario

Mark some implicit conversion operators, comparison or truth operators as obsolete. Then write a tuple comparison expression that involves those operators.
In 15.7 tuple comparisons failed to report such obsolete diagnostics.
In 15.8, we will properly report those diagnostics. This is a small compat break which will be reviewed with the compat council.

Bugs this fixes

Fixes #27047

Risk

Performance impact

Low. The change is localized to tuple binding and leveraging a common helper to check for obsolete conversions and report on them.

Is this a regression from a previous update?

No. This is a bug in the tuple-equality feature (in C# 7.3, shipped in 15.7).

How was the bug found?

Reported by customer

@jcouv jcouv added this to the 15.8 milestone May 26, 2018
@jcouv jcouv self-assigned this May 26, 2018
@jcouv jcouv requested a review from a team as a code owner May 26, 2018 05:50
@AlekseyTs
Copy link
Copy Markdown
Contributor

In 15.8, we will properly report those diagnostics.

Is this consistent with behavior of regular comparison operators?

Copy link
Copy Markdown
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (iteration 1)

@jcouv
Copy link
Copy Markdown
Member Author

jcouv commented May 29, 2018

Yes, the errors are consistent with regular comparison.
Here's a few examples to illustrate.

@jcouv
Copy link
Copy Markdown
Member Author

jcouv commented May 29, 2018

@dotnet/roslyn-compiler for a second review (small fix). Thanks

I've started internal thread with compat council to approve this compat break.

Copy link
Copy Markdown
Member

@gafter gafter left a comment

Choose a reason for hiding this comment

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

:shipit:

@jcouv
Copy link
Copy Markdown
Member Author

jcouv commented May 30, 2018

This breaking change was approved by the compat council.
@jaredpar for approval for 15.8 ask-mode. Thanks

@jaredpar
Copy link
Copy Markdown
Member

approved.

@jcouv jcouv merged commit d345ab2 into dotnet:master May 30, 2018
@jcouv jcouv deleted the obsolete-bug branch May 30, 2018 16:03
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.

Roslyn doesn't produce warnings/errors for [Obsolete] implicit conversions in tuple equality (C# 7.3)

4 participants