Consider exposing operation block for default constructor
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
The trim analyzer has a scenario where we would like to produce a warning for the default constructor's implicit call to the base constructor. Our analyzer works with operation blocks, so it would be convenient if there were a callback for the implicit default constructor operation block.
We can work around this by using the symbol APIs, but I wonder if it would make sense to expose the default ctor via operation APIs.
Note that if I write out a parameterless constructor in source, this does surface as an operation block (which includes the implicit call to the base constructor). The ask is just for an implicit parameterless constructor to behave the same.
See https://github.com/dotnet/runtime/issues/106796 for context.
Contributor guide
Assessment
This issue has not been assessed yet.