Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use init-only for records and adjust binding #44582

Merged
merged 9 commits into from
May 30, 2020

Commits on May 27, 2020

  1. Use init-only for records and adjust binding

    Changes records to generate init-only properties instead of get-only,
    and modifies the `with` expression to treat arguments as assignments
    to the left-hand side, with the safety rules of object initializers
    (meaning init-only assignments are allowed).
    
    Also changes records to generate a Clone method and a copy constructor.
    The clone calls the copy constructor and the copy constructor does a
    memberwise copy of the instance fields of the other type.
    
    This change also tries to simplify and reuse more pieces of binding and
    lowering from other initializer-based forms. The with-expression is now
    bound as though it were an assignment to a field or member access on a
    call to the Clone method.
    agocke committed May 27, 2020
    Configuration menu
    Copy the full SHA
    13e15e1 View commit details
    Browse the repository at this point in the history
  2. Add tests

    agocke committed May 27, 2020
    Configuration menu
    Copy the full SHA
    74e8c4a View commit details
    Browse the repository at this point in the history

Commits on May 28, 2020

  1. Configuration menu
    Copy the full SHA
    64ebad9 View commit details
    Browse the repository at this point in the history
  2. Respond to PR comments

    agocke committed May 28, 2020
    Configuration menu
    Copy the full SHA
    a8471fe View commit details
    Browse the repository at this point in the history

Commits on May 29, 2020

  1. Configuration menu
    Copy the full SHA
    1c7b14c View commit details
    Browse the repository at this point in the history
  2. Respond to PR comments

    agocke committed May 29, 2020
    Configuration menu
    Copy the full SHA
    9f605e2 View commit details
    Browse the repository at this point in the history
  3. Update src/Compilers/CSharp/Portable/Symbols/Synthesized/Records/Synt…

    …hesizedRecordClone.cs
    
    Co-authored-by: Jared Parsons <jaredpparsons@gmail.com>
    agocke and jaredpar authored May 29, 2020
    Configuration menu
    Copy the full SHA
    891fd42 View commit details
    Browse the repository at this point in the history
  4. Fix formatting

    agocke committed May 29, 2020
    Configuration menu
    Copy the full SHA
    bd18ab7 View commit details
    Browse the repository at this point in the history
  5. Fix formatting

    agocke committed May 29, 2020
    Configuration menu
    Copy the full SHA
    3f35beb View commit details
    Browse the repository at this point in the history