-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add friendlier error message on an explicit implementation when the return type is wrong #80376
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
Add friendlier error message on an explicit implementation when the return type is wrong #80376
Conversation
|
@stbau04 in general, please avoid force pushing to PRs in roslyn. It breaks our ability to incrementally review changes. We will squash your changes at the end anyway. |
|
Noted, i'll not do that again |
src/Compilers/CSharp/Portable/Symbols/Source/ExplicitInterfaceHelpers.cs
Outdated
Show resolved
Hide resolved
…Helpers.cs Co-authored-by: Fred Silberberg <fred@silberberg.xyz>
# Conflicts: # src/Compilers/CSharp/Portable/Errors/ErrorCode.cs # src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs
333fred
left a comment
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.
@dotnet/roslyn-compiler for a second review
|
Taking a look today, sorry I missed the notification. |
| // UnavailableClass[] CSharpErrors.InterfaceMethods.ReturnType2() { return null; } | ||
| Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "UnavailableClass").WithArguments("UnavailableClass").WithLocation(5, 5), | ||
| // (5,54): error CS0539: 'C.ReturnType2()' in explicit interface declaration is not a member of interface | ||
| // (5,54): error CS9334: 'C.ReturnType2()': return type must be 'UnavailableClass[]' to match implemented member 'InterfaceMethods.ReturnType2()' |
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.
If you wish, you could consider opening a follow up PR after this one, to avoid reporting a "bad implementation" error, when the implementation signature already has errors, which I believe is called out in the "CONSIDER" comment in the implementation.
|
Thanks for the contribution! |
Fixes #60742
New pr instead of #80267 as Github apparently behaves different in comparison to Bitbucket when a branch with pr is deleted and pushed again