Skip to content

C# 14 extension block on generic type fails at runtime #195

@ffried

Description

@ffried

Using the following code fails to translate at runtime:

public static class MyMappingExtensions
{
    extension(MyGenericWrapper<MyEntity> wrappedEntity)
    {
        [Projectable]
        public MyDto ToDto() => new() { /* ... */ }
    }
}

Exception: System.InvalidOperationException: Unable to resolve generated expression for MyProject.Mappers.MyMappingExtensions.ToDto.

Extension blocks on MyEntity directly work. So does above's method as a static method (removing the extension block).

Projectables Version: 6.0.0 which includes #141

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions