GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AOT formatter should be more flexible for member/parameter types · Issue #1851 · MessagePack-CSharp/MessagePack-CSharp

AOT formatter should be more flexible for member/parameter types #1851

New issue
Copy link
New issue
Copy link
Closed
Closed
AOT formatter should be more flexible for member/parameter types#1851
Copy link
Assignees
AArnott
Milestone
v3.0

Description

@AArnott
AArnott
opened on Jun 14, 2024
Issue body actions

The generated AOT formatter is invalid for the following class:

[SerializationConstructor]
public DiscoveredParts(IEnumerable<ComposablePartDefinition> parts, IEnumerable<PartDiscoveryException> discoveryErrors)
{
    this.Parts = ImmutableHashSet.CreateRange(parts);
    this.DiscoveryErrors = ImmutableList.CreateRange(discoveryErrors);
}

[Key(0)]
public ImmutableHashSet<ComposablePartDefinition> Parts { get; private set; }

[Key(1)]
public ImmutableList<PartDiscoveryException> DiscoveryErrors { get; private set; }

The formatter is correct when the parameter types match the member types, but it would be great if the formatter could deal with the parameter types being different from the member types, particularly when the member type is assignable to the parameter type (although the reverse would also be great to support, where the deserializer would just create the more derived type).

Activity

  1. AArnott
    added this to the v3.0 milestone on Jun 14, 2024
  2. AArnott
    self-assigned this
    on Jul 26, 2024
  3. AArnott
    added a commit that references this issue on Jul 26, 2024

    Allow deserializing constructor parameters to accept any type assigna…

    This issue will close once commit eca5313 is merged into the 'master' branch.
    eca5313
  4. AArnott
    closed this as completedon Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @AArnott
    AArnott

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    • v3.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.