-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
Area-IDEConcept-Continuous Improvementhelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Extracted from: #58491
class Program {
void Main()
{
Test x = new() { A = 1, B = 1 };
}
}
The genrating code for Test will be:
internal class Test
{
}
ignoring the initialization part. Unlike for this code:
class Program {
void Main()
{
var x = new Test() { A = 1, B = 1 };
}
}
the generated class is:
internal class Test
{
public Test()
{
}
public int A { get; set; }
public int B { get; set; }
}
In fact, the two cases co-exist:
Test x = new Test() { A = 1, B = 1 };
Generating the class from Test x
will not generate the fields, unlike generating it from new Test()
.
I think the generator should look for an initializer at the right hand side.
VBAndCs
Metadata
Metadata
Assignees
Labels
Area-IDEConcept-Continuous Improvementhelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Type
Projects
Status
Completed