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: Usage restriction analyzer #45

Open
ronnygunawan opened this issue Mar 1, 2021 · 0 comments
Open

New analyzer: Usage restriction analyzer #45

ronnygunawan opened this issue Mar 1, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ronnygunawan
Copy link
Owner

[RestrictTo(Namespace = "Baz")]
public class Foo { }

namespace Bar {
    class C : Foo { } // Error: Usage of 'Foo' is only allowed in namespace 'Baz'
}

namespace Baz {
    class C : Foo { } // No error
}

The attribute can be applied to class, record, struct, enum, delegate, property, field, method, constructor, event, etc

@ronnygunawan ronnygunawan self-assigned this Mar 1, 2021
@ronnygunawan ronnygunawan added the enhancement New feature or request label Mar 1, 2021
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