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

Null warnings not reported for iterator methods #23701

Closed
cston opened this issue Dec 10, 2017 · 0 comments
Closed

Null warnings not reported for iterator methods #23701

cston opened this issue Dec 10, 2017 · 0 comments
Assignees
Labels
Area-Compilers Bug Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@cston
Copy link
Member

cston commented Dec 10, 2017

yield return null; should generate warning: cannot convert null to non-nullable reference:

using System.Collections.Generic;
class C
{
    static IEnumerable<object> F()
    {
        yield return null;
    }
    static IEnumerable<T> G<T>() where T : class
    {
        yield return null;
    }
}
@jcouv jcouv added this to the 16.0 milestone Dec 15, 2017
@jcouv jcouv self-assigned this Aug 5, 2018
@jaredpar jaredpar added the Bug label Aug 31, 2018
@jcouv jcouv modified the milestones: 16.0, 16.0.P2 Nov 10, 2018
@jcouv jcouv added the 4 - In Review A fix for the issue is submitted for review. label Nov 11, 2018
@jcouv jcouv closed this as completed Nov 14, 2018
@jcouv jcouv added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

3 participants