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

Inlining collection expression local into a spread could inline more aggressively #73148

Open
jcouv opened this issue Apr 20, 2024 · 1 comment
Labels
Area-IDE help wanted The issue is "up for grabs" - add a comment if you are interested in working on it New Feature - Collection Expressions
Projects
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Apr 20, 2024

Invoking "Inline Temporary Variable" on the first variable:

        string[] eStaticSymbols = [
            "System.Int32 E.StaticProperty { get; }",
            "void E.StaticMethod()",
            "E.Nested",
            "event System.Action E.StaticEvent",
            "System.Int32 E.StaticField"];

        string[] allStaticSymbols = [
            .. eStaticSymbols,
            "System.Int32 E2.StaticProperty { get; }"];

results in the following:

        string[] allStaticSymbols = [
            .. ((string[])([
            "System.Int32 E.StaticProperty { get; }",
            "void E.StaticMethod()",
            "E.Nested",
            "event System.Action E.StaticEvent",
            "System.Int32 E.StaticField"])),
            "System.Int32 E2.StaticProperty { get; }"];

Seems a good opportunity for better inlining.

FYI @CyrusNajmabadi

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 20, 2024
@CyrusNajmabadi
Copy link
Member

Probably better as two features. Inlining just inlines. But there could be a suggestion to collapse a spread of individual expressions instead just being those expressions.

@genlu genlu removed the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 24, 2024
@CyrusNajmabadi CyrusNajmabadi removed their assignment Apr 29, 2024
@CyrusNajmabadi CyrusNajmabadi added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Apr 29, 2024
@CyrusNajmabadi CyrusNajmabadi added this to InQueue in Small Fixes via automation Apr 29, 2024
@CyrusNajmabadi CyrusNajmabadi added this to the Backlog milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE help wanted The issue is "up for grabs" - add a comment if you are interested in working on it New Feature - Collection Expressions
Projects
Small Fixes
  
InQueue
Development

No branches or pull requests

3 participants