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

IQueryable<T> extension method crash Roselyn code generation #1627

Open
3 tasks done
Velka-DEV opened this issue Dec 2, 2024 · 3 comments
Open
3 tasks done

IQueryable<T> extension method crash Roselyn code generation #1627

Velka-DEV opened this issue Dec 2, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Velka-DEV
Copy link

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

Using any IQueryable extension method in mapper actually crash the roselyn generation process making unable to generate any code behind.

Declaration code example

public static partial IQueryable<CategoryDto> ProjectToDto(this IQueryable<Category> source);

Environment (please complete the following information):

  • Mapperly Version: 4.1.1
  • Nullable reference types: [e.g. enabled]
  • .NET Version: 8
  • Target Framework: net8
  • Compiler Version:4.11.0-3.24510.3 (cfe3bd0a)
  • C# Language Version: 12
  • IDE: Rider 2024.3
  • OS: macos 15.2
@Velka-DEV Velka-DEV added the bug Something isn't working label Dec 2, 2024
@latonz
Copy link
Contributor

latonz commented Dec 9, 2024

I cannot reproduce this, could you create a minimal reproducible project on github?

@Velka-DEV
Copy link
Author

I cannot reproduce this, could you create a minimal reproducible project on github?

I tried but I can't reproduce it in another repository. It seems it's related to something in our application. Do you know where I can grab the Roselyn logs ?

@latonz
Copy link
Contributor

latonz commented Dec 16, 2024

Are there any diagnostics you can see? Does the build work on the CLI? If this doesn't help you could debug your codebase with DebugRoslynComponent (see also docs). This works for me:

[Mapper]
public static partial class Mapper
{
    public static partial IQueryable<Target> Map(IQueryable<Source> sources);

    [MapValue(nameof(Target.NotInSource), null)]
    [MapperIgnoreSource(nameof(Source.NotInTarget))]
    private static partial Target Map(Source source);
}

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
Development

No branches or pull requests

2 participants