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

New analyzer: var's inferred type is obsolete #23

Closed
ronnygunawan opened this issue Dec 11, 2019 · 1 comment
Closed

New analyzer: var's inferred type is obsolete #23

ronnygunawan opened this issue Dec 11, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ronnygunawan
Copy link
Owner

[Obsolete]
class A {
}

class B {
#pragma warning disable CS0612
    public A A { get; } = new A();
#pragma warning restore CS0612
}

class C {
    public void Test() {
        var b = new B();
        var a = b.A; // Warning: A is obsolete
    }
}

related: dotnet/roslyn#40004

@ronnygunawan ronnygunawan self-assigned this Dec 11, 2019
@ronnygunawan ronnygunawan added the enhancement New feature or request label Dec 11, 2019
@ronnygunawan
Copy link
Owner Author

Added in 1.0.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant