-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remove CS1701 and CS1702 warnings #66313
base: main
Are you sure you want to change the base?
Conversation
Draft for now. I'll debug the failing tests later :( |
Are all use-site diagnostics on symbols errors now? As in VB. If so, we probably should rename all relevant APIs that use "UseSiteDiagnostic" to "UseSiteError" to reflect the fact. Some checks for use-site errors (vs. warnings), if any, could be simplified as well. Also, we should see if calculation/merging of use-site diagnostics could be optimized/simplified (get out early, etc.) now. |
@AlekseyTs Could this be done in a separate follow-up PR (and open an issue to track that)? |
I think that if we want to address the issue, we should do that without any need for an additional follow up. I do not see any urgency in stopping reporting the warnings. If we think that the issue is worth addressing, we should do that in its entirety. |
@AlekseyTs I took a look roslyn/src/Compilers/CSharp/Portable/Symbols/ConstraintsHelper.cs Lines 1048 to 1055 in ab23769
and if I understand correctly, we can't get simplify anything here. Am I correct? |
I am primarily referring to the following APIs on
By contrast VB has only:
I was referring to legacy names for the APIs. So, I withdraw this suggestion.
Given the example where nullable warnings are added to the
I am primarily referring to the way we calculate value returned by |
@@ -72,30 +72,11 @@ public void VersionUnification_SymbolUsed() | |||
// reference asks for a higher version than available: | |||
var testRefV2 = CreateCompilation("public class E : D { }", new MetadataReference[] { new CSharpCompilationReference(refV2), v1 }, assemblyName: "testRefV2"); | |||
|
|||
// TODO (tomat): we should display paths rather than names "refV1" and "C" | |||
|
|||
testRefV1.VerifyDiagnostics( |
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.
@@ -187,15 +168,7 @@ public void F() | |||
new CSharpCompilationReference(refLibV2) | |||
}); | |||
|
|||
// TODO (tomat): we should display paths rather than names "RefLibV2" and "Lib" | |||
|
|||
main13.VerifyDiagnostics( |
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.
According to the comment above, it looks like the goal of the test was to verify that: "higher version should be preferred over lower version regardless of the order of the references". It also looks like the fact was verified indirectly by checking diagnostics. If we no longer can rely on this approach, we should find a different way to verify the outcome. It feels like we might want other tests that primarily were verifying presence of the warnings (at least all tests in this file) be adjusted in a similar way.
Marking PR as draft for now, to make room in our review queue. Please undraft when ready for another look. Thanks |
Very quick PR to fix #19640