You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When binding an instance method group, we try twice. First, assuming we will find something applicable, we apply the language rules correctly. Then, if that fails, we are more relaxed and gather even inapplicable and inaccessible candidates. This permits us to produce better diagnostics and information from SemanticModel for failed invocations.
However, we only do one pass for extension methods. As a result the SemanticModel has to do some work on its own to try to reconstruct things. It cannot always do a decent job. Below shows a regression in a test in a recent PR due to this. There was a line that used to read
When binding an instance method group, we try twice. First, assuming we will find something applicable, we apply the language rules correctly. Then, if that fails, we are more relaxed and gather even inapplicable and inaccessible candidates. This permits us to produce better diagnostics and information from
SemanticModel
for failed invocations.However, we only do one pass for extension methods. As a result the
SemanticModel
has to do some work on its own to try to reconstruct things. It cannot always do a decent job. Below shows a regression in a test in a recent PR due to this. There was a line that used to readthat now reads
That is because the compiler now avoids considering inaccessible methods when resolving extension methods (this was necessary to fix #25813)
The offending test is
The text was updated successfully, but these errors were encountered: