Skip to content

Another generic extension decompilation error similar to #298 #303

@beno-pete

Description

@beno-pete

Similar to #298 just with another argument, error decompiling case without explicit type cast (event with 0.35.1):
Working properly with pre 0.35.

using DelegateDecompiler;
using System.Linq;

namespace ConsoleApp1;

static class Program
{
    static void Main()
    {
        var q = new Cls[0].AsQueryable();
        var a = DecompileExtensions.Decompile(q.Select(x => x.Ext1(0)));
        var b = DecompileExtensions.Decompile(q.Select(x => x.Ext2(0)));
    }

    [Computed]
    public static int Ext1<T>(this T value, int i) where T : Intf => ((Intf)value).Value(i);

    [Computed]
    public static int Ext2<T>(this T value, int i) where T : Intf => value.Value(i);

}

public interface Intf
{
    public int Value(int i) => i;
}

public class Cls : Intf
{
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions