Skip to content

Ambiguous Constructor Call on Partial Record w/ One Property #8

@MooVC

Description

@MooVC

Describe the bug
It is not possible to apply Fluentify to a partial record that has only one property defined.

To Reproduce
Define a partial record with just one property and annotate it with Fluentify e.g.

[Fluentify]
public partial record Pie(string Type);

The code will fail to compile due to the following error:

Error (active)	CS0121	The call is ambiguous between the following methods or properties: 'Pie.Pie(string)' and 'Pie.Pie(Pie)'

Expected behavior
The code should compile, with an extension method generated for the property and a default constructor generated for the record.

Environment (please complete the following information):

  • Fluentify Version: 1.1.0
  • .NET Version (Your Project): NET 8
  • IDE: Visual Studio 2022 (17.10.5)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions