Skip to content

Better support of record types #39

@rpallares

Description

@rpallares

Documentation for records are working well, it's technically generate what the compiler service do.
But, some of generated stuffs are a bit redundant and reduce readability on records.

  1. The record should be displayed as record (output as class, that is technically not false but...)
  2. The type declaration have annoying assembly string representation ( instead of IEquatable):

Content

Namespace: MyNamespace

public class Content : System.IEquatable`1[[MyNamespace.Content, MyNamespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
  1. On record, compiler generate GetHashCode, Equals, Clone (that's technically true, but redundant with "record").

Could we imagine adding some flags in command line to display records as record instead of class and omit all generated methods and interfaces (IEquatable in that case) ?
It could be something like "simplified-record", or have an option to skip all CompilerGenerated methods / interfaces ?

Ideally it should also work with record structs (not tested).

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions