-
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
Collection expression arguments: initial binding and lowering #76903
base: features/dictionary-expressions
Are you sure you want to change the base?
Collection expression arguments: initial binding and lowering #76903
Conversation
…s' into collection-args
…s' into collection-args
@@ -6841,6 +6841,9 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ | |||
<data name="IDS_FeatureCollectionExpressions" xml:space="preserve"> | |||
<value>collection expressions</value> | |||
</data> | |||
<data name="IDS_FeatureCollectionExpressionArguments" xml:space="preserve"> | |||
<value>collection expression arguments</value> | |||
</data> |
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.
Grrrr #Resolved
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.
Yes, these two resource strings are essentially the ones you added and removed from #76003.
@@ -6880,6 +6883,9 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ | |||
<data name="ERR_CollectionExpressionKeyValuePairNotSupported" xml:space="preserve"> | |||
<value>Collection expression type '{0}' does not support key-value pair elements.</value> | |||
</data> | |||
<data name="ERR_CollectionArgumentsMustBeFirst" xml:space="preserve"> | |||
<value>Collection arguments must be the first element.</value> | |||
</data> |
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.
Grr * 2.
Note i think this should be called "collection argument element" or just "'with' element. Saying the arguments (plural) must be the first element (singular) reads oddly to me. #Resolved
{ | ||
internal partial class BoundUnconvertedCollectionArguments | ||
{ | ||
internal void GetArguments(AnalyzedArguments analyzedArguments) |
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.
fwiw, havin thtis be called GetArguments and not return something reads oddly. Consider .AddArgumentsTo, which makes it much clearer that the receiver is adding the arguments to the passed in value. #ByDesign
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.
I'd like to leave this as is. The intended use is to populate the AnalyzedArguments
collection with just the arguments, rather than to add to an existing collection (we assert the collection is empty initially), so renaming to AddArgumentsTo
might make the intent less clear.
9a04311
to
b41f88f
Compare
Binding and lowering of collection expression arguments for
class
andstruct
target types that implementIEnumerable
and do not have a[CollectionBuilder]
attribute.