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

Use collection initializers or expressions #9090

Closed
wants to merge 2 commits into from
Closed

Use collection initializers or expressions #9090

wants to merge 2 commits into from

Conversation

kzu
Copy link
Contributor

@kzu kzu commented Jul 30, 2024

This is the recommented way and is starting to be applied throughout the dotnet runtime. See dotnet/runtime#105122.

Applied code fixes for:

Microsoft Reviewers: Open in CodeFlow

@kzu
Copy link
Contributor Author

kzu commented Jul 30, 2024

The second commit catches the cases of new[] { that were not flagged (nor autofixed) by the analyzers.

The ambiguous API call compilation errors are due to not having the .NET 9 compiler smarts :(

@kzu kzu changed the title Use collection initialization syntax in code generator Use collection initializers or expressions Jul 30, 2024
@kzu kzu marked this pull request as draft July 30, 2024 19:24
@@ -20,44 +20,44 @@ public class DynamoDBGatewayListProviderHelper
/// <param name="options"></param>
internal static void ParseDataConnectionString(string dataConnectionString, DynamoDBGatewayOptions options)
{
var parameters = dataConnectionString.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
var parameters = dataConnectionString.Split([ ';' ], StringSplitOptions.RemoveEmptyEntries);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's an overload now that that takes a char. Isn't that available in the tfm we're targeting?

@kzu kzu closed this by deleting the head repository Oct 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants