Skip to content

Extract Local should infer from object initializer properties #21602

@SLaks

Description

@SLaks

Version Used: 15.3

var x = new { y = DateTime.Now.ToString() };

Expected:

string y = DateTime.Now.ToString();
var x = new { y };

Actual:

string v = DateTime.Now.ToString();
var x = new { y = v };

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Completed

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions