-
Notifications
You must be signed in to change notification settings - Fork 4k
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 IParameterSymbol.IsParamCollection
property
#71816
Comments
Thoughts/questions for review.
I would consider having us add an IsParamsArray property to go with IsParamsCollection. And consider deprecating IsParams and telling users to use one of the others :) |
That is to match name of the attribute that is supposed to mark the parameter in metadata,
From metadata:
For correct source code, only one of the attributes will be emitted and the properties will reflect the fact (again, no change for Therefore, for conventional metadata and for source, both properties are never true.
This is definitely an option. However, implementers will still have to implement the deprecated property, but in a prescribed way (I think we cannot use default interface implementations). Also, existing consumers of |
API Review
Conclusion: We will go with option 3, with |
Background and Motivation
Related to "Params Collections" feature work.
Proposed API
Alternative Designs
Option 1
We could extend the meaning of
IsParams
property to return true for non-array param collections instead,but then VB, for example, will print C# methods like
which is likely to confuse the user. VB is not going to support params collections.
Other consumers can be affected in a similar way.
Option 2
As the top proposal, but with additional new property:
Option 3
Have
IsParams
return true if if the parameter was declared either as a parameter array,or a parameter collection. Add new property for parameter aray.
Risks
The text was updated successfully, but these errors were encountered: