Skip to content

Poor error message for mismatching function pointers #51224

@YairHalberstadt

Description

@YairHalberstadt

Version Used: master as of 2d3ffe0 (9th feb)

Steps to Reproduce:

unsafe
{
    delegate* <ref int> fp1 = default;
    delegate* <int> fp2 = fp1;
}

Expected Behavior:

error CS0266: Cannot implicitly convert type 'delegate*<ref int>' to 'delegate*<int>'. An explicit conversion exists (are you missing a cast?)

Actual Behavior:

error CS0266: Cannot implicitly convert type 'delegate*<int>' to 'delegate*<int>'. An explicit conversion exists (are you missing a cast?)

Note the signatures delegate*<int> in the actual error message which is very confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions