Skip to content

Missing type info for method group conversions? #1789

@yyjdelete

Description

@yyjdelete

Tested with master

There is no tooltip, link and highlighting for both Func<>(the inside int works well) and Method1 in the cast

int Method1()
{
    return new Func<int>(Method1)();//new Func<int>(Method1).Invoke();
}

Maybe for Func<> and dynamic, the special logic for ObjectCreateExpression should fallback to normal logic if the parent don't have an symbol?
But not sure what happen for Method1.

if (symbol != null && node.Parent is ObjectCreateExpression) {
symbol = node.Parent.GetSymbol();
}

if (symbol != null && node.Role == Roles.Type && node.Parent is ObjectCreateExpression) {
symbol = node.Parent.GetSymbol();
}

var node = nodeStack.Peek();
ISymbol symbol;
if (node.Role == Roles.Type && node.Parent is ObjectCreateExpression) {
symbol = node.Parent.GetSymbol();
} else {
symbol = nodeStack.Peek().GetSymbol();
}

And also for some other ugly code(use dynamic to hit the others code path).(check decimal and List<>)

            _ = new decimal((dynamic)1);
            _ = new List<int>((dynamic)110);

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugC#DecompilerThe decompiler engine itselfOutputOutput code formatting; hyperlinks/tooltips on output code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions