Provide line numbers for exceptions in object initializer expressions
Open
Area-Interactive
Interactive-Debugging
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
When using object initializers, like above, all exception stack traces point to the main statement
```
var myObject = new MyClass
{
Property1 = F(),
Property2 = G(),
}
```
This is very suboptimal from an error handling exception, making it so we don't use non-trivial object initializers where I work.
Could this be improved so we get real sequence points between each initialization?
I have seen #5477, which is similar, but relates to anonymous types, so I think this suggestion is slightly different (without knowing the details about lowering, I hope each assignment is its own statement
Contributor guide
Assessment
This issue has not been assessed yet.