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

Method type inference should make inference from explicit lambda return type #54257

Closed
cston opened this issue Jun 21, 2021 · 0 comments · Fixed by #56534
Closed

Method type inference should make inference from explicit lambda return type #54257

cston opened this issue Jun 21, 2021 · 0 comments · Fixed by #56534

Comments

@cston
Copy link
Member

cston commented Jun 21, 2021

The call to F(int (i) => i) should infer F<int>(Func<int, int> f):

using System;

class Program
{
    static void F<T>(Func<T, T> f) { }
    
    static void Main()
    {
        F(int (i) => i); // ok
    }
}

See LDM notes.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 21, 2021
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 12, 2021
@jaredpar jaredpar added this to the 17.0 milestone Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants