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

No nullability warning for a Linq expression #31935

Closed
savahmel opened this issue Dec 19, 2018 · 1 comment
Closed

No nullability warning for a Linq expression #31935

savahmel opened this issue Dec 19, 2018 · 1 comment
Labels
Area-Compilers Bug New Language Feature - Nullable Reference Types Nullable Reference Types Resolution-Duplicate The described behavior is tracked in another issue
Milestone

Comments

@savahmel
Copy link

Visual Studio 2019 Preview 1.1

The following code produces no warning and results in null reference exception.

#nullable enable
using System;
class Program
{ 
    static void Main(string[] args)
    {
        string? s = null;
        System.Linq.Expressions.Expression<Func<bool>> ex = () => 0 == s.Length;
        ex.Compile()();
    }
}

Expecting to get a warning on the dereferencing of s.Length

@jaredpar
Copy link
Member

Thanks for taking the time to file this! Looks like a duplicate of #29863

@jaredpar jaredpar added the Resolution-Duplicate The described behavior is tracked in another issue label Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug New Language Feature - Nullable Reference Types Nullable Reference Types Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

3 participants