-
Notifications
You must be signed in to change notification settings - Fork 86
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
Example in 18.4.6 is incorrect: calling an ambiguous-looking interface member can work... #1062
Comments
Interestingly, if the type of the |
FWIW, "Microsoft (R) Visual C# Compiler version 4.8.9037.0 for C# 5" warns about the ambiguity:
Microsoft (R) Visual C# Compiler version 2.10.0.0 (b9fb1610) doesn't. Roslyn source code has it commented out: https://github.com/dotnet/roslyn/blob/958f2354c4d83dbb0e7723d0a8079a0dfbc33f25/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs#L321
|
Thanks for digging, @KalleOlaviNiemitalo! Will see whether @ericlippert remembers the details... |
Microsoft's warning CS0467 documentation doesn't mention this being obsolete, and includes almost the same IListCounter example. |
We believe there is a specified preference for methods when performing member lookup of "something that looks like an invocation". I will try to find it. |
We have the following example in 18.4.6 (which isn't tested as it's marked for "needs review"):
With text:
However, the first of these statements works when running the example tester. It's only the second which fails (CS1656: Cannot assign to 'Count' because it is a 'method group').
Has interface member lookup changed in a way that has made the first statement become valid, or has the spec always just been wrong?
The text was updated successfully, but these errors were encountered: