Skip to content
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 expressions #256

Closed
Tracked by #9
adrianoc opened this issue Dec 8, 2023 · 0 comments
Closed
Tracked by #9

Collection expressions #256

adrianoc opened this issue Dec 8, 2023 · 0 comments
Labels
enhancement New feature or request .NET 8.0 Work that depends on .NET 8.0
Milestone

Comments

@adrianoc
Copy link
Owner

adrianoc commented Dec 8, 2023

Documentation

Example in sharplab

@adrianoc adrianoc mentioned this issue Dec 8, 2023
100 tasks
@adrianoc adrianoc added the enhancement New feature or request label Dec 8, 2023
@adrianoc adrianoc added the .NET 8.0 Work that depends on .NET 8.0 label Jan 16, 2024
@adrianoc adrianoc modified the milestones: 2.10, 2.11 Mar 22, 2024
@adrianoc adrianoc added this to the Future milestone Jun 7, 2024
@adrianoc adrianoc modified the milestones: Future, 2.14 Aug 23, 2024
adrianoc added a commit that referenced this issue Sep 25, 2024
adrianoc added a commit that referenced this issue Sep 29, 2024
adrianoc added a commit that referenced this issue Sep 29, 2024
…tialization (#256)

also:
1. Extracts SyntaxWalkerBase.EnsureForwardedMethod() -> MethodExtensions.EnsureForwardedMethod()
2. Fixes variable names when handling constructors in some scenarios
adrianoc added a commit that referenced this issue Sep 30, 2024
Test was using [2, 1] hardcoded collection expression instead of the parameterized values whence collection
expressions larger than 2 were not being tested.

Since this length is used to determine how the initialization is performed optimized initialization (length >= 3)
was not being tested.

Fixing this revealed a bug in the logic that selects optimized/unoptimized initialization. AFAICS optimization is only
applicable when the target of the collection expression (i.e, a variable assignment/initialization or argument passing)
is a container (array/collection/etc) of primitive types but the code was not taking this into consideration.
adrianoc added a commit that referenced this issue Sep 30, 2024
adrianoc added a commit that referenced this issue Sep 30, 2024
adrianoc added a commit that referenced this issue Sep 30, 2024
…tialization (#256)

also:
1. Extracts SyntaxWalkerBase.EnsureForwardedMethod() -> MethodExtensions.EnsureForwardedMethod()
2. Fixes variable names when handling constructors in some scenarios
adrianoc added a commit that referenced this issue Sep 30, 2024
Test was using [2, 1] hardcoded collection expression instead of the parameterized values whence collection
expressions larger than 2 were not being tested.

Since this length is used to determine how the initialization is performed optimized initialization (length >= 3)
was not being tested.

Fixing this revealed a bug in the logic that selects optimized/unoptimized initialization. AFAICS optimization is only
applicable when the target of the collection expression (i.e, a variable assignment/initialization or argument passing)
is a container (array/collection/etc) of primitive types but the code was not taking this into consideration.
adrianoc added a commit that referenced this issue Sep 30, 2024
also refactor the test code to better convey intent and avoid code duplication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request .NET 8.0 Work that depends on .NET 8.0
Projects
None yet
Development

No branches or pull requests

1 participant