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

Warning inferring nullability of lambda return type tuple #32006

Open
cston opened this issue Dec 23, 2018 · 0 comments
Open

Warning inferring nullability of lambda return type tuple #32006

cston opened this issue Dec 23, 2018 · 0 comments

Comments

@cston
Copy link
Member

cston commented Dec 23, 2018

using System;

class Program
{
    static T F<T>(Func<bool, T> f)
    {
        return f(true);
    }

    static void G<T>(object x)
    {
        F(b =>
        {
            if (b) return (x, null); // warning
            return (x, x);
        });
    }
}
(14,27): warning CS8619: Nullability of reference types in value of type '(object x, object?)'
    doesn't match target type '(object, object)'.
@cston cston self-assigned this Dec 23, 2018
@jcouv jcouv self-assigned this Dec 31, 2018
@jcouv jcouv modified the milestones: 16.0.P2, 16.0 Dec 31, 2018
@jaredpar jaredpar added the Bug label Jan 2, 2019
@jaredpar jaredpar added this to Misc in Nullable Board Jan 28, 2019
@jaredpar jaredpar moved this from Misc to Suppression in Nullable Board Jan 28, 2019
@jaredpar jaredpar moved this from Suppression to ref in Nullable Board Jan 28, 2019
@jaredpar jaredpar moved this from ref to Generated Code in Nullable Board Jan 28, 2019
@jaredpar jaredpar moved this from Generated Code to Nullable<T> in Nullable Board Jan 28, 2019
@jaredpar jaredpar moved this from Nullable<T> to Lambda in Nullable Board Jan 28, 2019
@jcouv jcouv modified the milestones: 16.0, 16.1 Mar 18, 2019
@gafter gafter assigned gafter and unassigned cston and jcouv Apr 16, 2019
@gafter gafter added this to Active Work in Compiler: Gafter Apr 16, 2019
@gafter gafter moved this from Active Work to Nullable in Compiler: Gafter Apr 16, 2019
@jcouv jcouv modified the milestones: 16.1, 16.2 Apr 23, 2019
@gafter gafter modified the milestones: 16.2, 16.3 Jun 3, 2019
@jcouv jcouv modified the milestones: 16.3, Compiler.Next Jul 10, 2019
@gafter gafter removed their assignment Jul 14, 2019
@gafter gafter removed this from Nullable in Compiler: Gafter Jul 14, 2019
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Nullable Board
Local functions and lambdas
Development

No branches or pull requests

4 participants