Skip to content

Treat records equal to classes #1576

Description

@daveMueller

This is a proposed design change related to records. As records in the IL are just classes with some generated methods we should also treat them like classes. With issue #1139 we implemented records (with primary constructor) to be completely excluded from instrumentation when auto properties are skipped. This is somehow troublesome because in the IL there is no difference to classes or records with auto properties.
As an example, when we SkipAutoProps the instrumentation of a record with a primary consturctor is completely skipped and looks like this:

grafik

If we now compare this to an equivalent class with the same coverage parameters, the assignement in the constructor is still beeing instrumented (even with SkipAutoProps).

grafik

I would suggest to do the same for records. As assignement in the constructor and definition of properties is all part of the primary constructor, it also should be instrument even if auto properties are skipped.

grafik

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions