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

global usings are not supported (colliding namespaces) #298

Closed
latonz opened this issue Mar 28, 2023 · 1 comment · Fixed by #318
Closed

global usings are not supported (colliding namespaces) #298

latonz opened this issue Mar 28, 2023 · 1 comment · Fixed by #318
Labels
bug Something isn't working

Comments

@latonz
Copy link
Contributor

latonz commented Mar 28, 2023

If one namespace collides with the name of another one, Mapperly generates invalid code.

Example:

namespace Payments
{
    public class Invoice {}
}

namespace A.Payments
{
    public class InvoiceDto {}

    [Mapper]
    public partial class Mapper
    {
        public partial InvoiceDto ToDto(global::Payments.Invoice invoice);
    }
}

Generated code:

namespace A.Payments
{
    [Mapper]
    public partial class Mapper
    {
       // Payments.Invoice is not found since there is no Payments.Invoice class in A.Payments.
        public partial InvoiceDto ToDto(Payments.Invoice invoice) {}
    }
}
@latonz latonz added the bug Something isn't working label Mar 28, 2023
ismaeel-ch added a commit to ismaeel-ch/mapperly that referenced this issue Apr 9, 2023
ismaeel-ch added a commit to ismaeel-ch/mapperly that referenced this issue Apr 11, 2023
ismaeel-ch added a commit to ismaeel-ch/mapperly that referenced this issue Apr 12, 2023
ismaeel-ch added a commit to ismaeel-ch/mapperly that referenced this issue Apr 12, 2023
ismaeel-ch added a commit to ismaeel-ch/mapperly that referenced this issue Apr 12, 2023
ismaeel-ch added a commit to ismaeel-ch/mapperly that referenced this issue Apr 12, 2023
@github-actions
Copy link

🎉 This issue has been resolved in version 2.8.0-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant