List patterns: use the same binding path as range indexers#53784
List patterns: use the same binding path as range indexers#53784alrz wants to merge 10 commits intodotnet:features/list-patternsfrom
Conversation
This comment has been minimized.
This comment has been minimized.
| BindingDiagnosticBag diagnostics, | ||
| ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, | ||
| bool forPattern = false) | ||
| ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) |
There was a problem hiding this comment.
Not for this PR: I was looking at this code some more (to merge conflicts from main branch) and wondered why we have both diagnostics and use-site info in this signature and some relates ones.
There was a problem hiding this comment.
@jcouv Should we create a DiagnosticBag off of useSiteInfo where we need one? I don't know if that's possible though.
There was a problem hiding this comment.
@alrz I can't look at the full code at the moment, so this is a general thought:
If this method selects a property to use, then a diagnostic bag should be enough (no need to delay the "use").
If the method only returns a candidate, then it should only produce use-site information but not use a diagnostic bag. The caller which decides to use the candidate is responsible for recording the use (ie transferring use-site information into diagnostic bag).
There was a problem hiding this comment.
Yeah I think we should use useSiteInfo for everything here e.g. obsolete errors and others.
I was looking for AddDiagnostics(UseSiteInfo<TAssemblySymbol> info) I think that's the one we should use.
…t-patterns-03 # Conflicts: # src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
|
Merged to #54335 |
Test plan: #51289