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

Generate field/property not working in top-level statement. #58491

Open
CyrusNajmabadi opened this issue Dec 25, 2021 · 4 comments
Open

Generate field/property not working in top-level statement. #58491

CyrusNajmabadi opened this issue Dec 25, 2021 · 4 comments
Assignees
Milestone

Comments

@CyrusNajmabadi
Copy link
Member

The following works:

class C
{
    static void Main(string[] args)
    {
        Test x = new() { A = 1, B = 1 };
    }
}

class Test { 
}

image

But this does not:

var x = new Test() { A = 1, B = 1 };
class Test
{
}

image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 25, 2021
@VBAndCs

This comment has been minimized.

@CyrusNajmabadi
Copy link
Member Author

@VBAndCs that is a separate issue. I've extract it out to #58495. Thanks.

@VBAndCs
Copy link

VBAndCs commented Dec 26, 2021

@CyrusNajmabadi
My advice is to review how all code fixes act in top level code (or at least some variety of them). Maybe fixing this doesn't cover all potintial issues in this mode.

@CyrusNajmabadi
Copy link
Member Author

@VBAndCs

My advice is to review how all code fixes act in top level code (or at least some variety of them).

We would welcome such an effort. If you're interested, i'm totally willing to work with you on this sort of thing. Thanks!

@jinujoseph jinujoseph added the Bug label Jan 4, 2022
@jinujoseph jinujoseph assigned sharwell and unassigned davidwengier Jan 4, 2022
@jinujoseph jinujoseph added this to the 17.1 milestone Jan 4, 2022
@jinujoseph jinujoseph removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jan 4, 2022
@jinujoseph jinujoseph modified the milestones: 17.1, 17.3 Apr 27, 2022
@arkalyanms arkalyanms modified the milestones: 17.3, 17.6 P2 Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants