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 warnings for field initializer with implicit constructor #31139

Closed
cston opened this issue Nov 13, 2018 · 0 comments
Closed

No warnings for field initializer with implicit constructor #31139

cston opened this issue Nov 13, 2018 · 0 comments

Comments

@cston
Copy link
Member

cston commented Nov 13, 2018

A warning is reported for A.x but no warning is reported for B.y.

class A
{
    object x = F(null); // warning
    A() { }
    static object F(object o) => o;
}
class B
{
    object y = F(null); // no warning
    static object F(object o) => o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant