Skip to content

error CS0757: A partial method may not have multiple implementing declarations #2161

@KeNJiKunG

Description

@KeNJiKunG

Please do the checklist before filing an issue:

  • I have read the documentation, including the FAQ
  • I can reproduce the bug using the latest prerelease version
  • I have searched existing discussion and issue to avoid duplicates

Describe the bug
Compiler ends with error CS0757. I have tried with .NET 9, 8 but errors still occurred. The generated codes is correct and have only 1 file. It gone after I set PrivateAssets="all".

Declaration code

#:package Riok.Mapperly@4.3.1

using Riok.Mapperly.Abstractions;

namespace Test;

public class Class1
{
    public int a { get; set; }
}

public class Class2
{
    public int a { get; set; }
}

[Mapper]
public static partial class Mapper
{
    public static partial Class1 To1( Class2 class2 );
}

Environment (please complete the following information):

  • Mapperly Version: [e.g. 4.3.1]
  • Nullable reference types: [e.g. enabled]
  • .NET Version: [e.g. .NET 10.0.200--preview.0.26103.119]
  • Target Framework: [e.g. .net10.0]
  • IDE: [e.g. Visual Studio Code]
  • OS: [e.g. Windows 11]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions