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

Confusing error message when trying to create delegate from method group of ref extension method with closed 'this' argument #25183

Open
controlflow opened this issue Mar 2, 2018 · 0 comments
Labels
Area-Compilers Bug Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings.
Milestone

Comments

@controlflow
Copy link

Version Used:

master branch @ march 2

Steps to Reproduce:

static class C {
  static int M(in this int x) => 1;
  static void Main() {
    System.Func<int> f = 1.M;
  }
}

Expected Behavior:

CS1113: Extension method 'C.M(int)' defined on value type 'int' cannot be used to create delegates

Actual Behavior:

CS0123: No overload for 'M' matches delegate 'Func'

@jcouv jcouv added Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. labels Mar 2, 2018
@jaredpar jaredpar added this to the Unknown milestone Aug 31, 2018
@gafter gafter added the Bug label Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings.
Projects
None yet
Development

No branches or pull requests

4 participants