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

Proposal: Add attributes which run custom functions to and throw compiler errors on fail. #16110

Closed
henrikklarup opened this issue Dec 27, 2016 · 1 comment
Labels
Area-Analyzers Feature Request Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented

Comments

@henrikklarup
Copy link

Add some way of putting attributes on different classes/enums and run custom functions for validation on compile time.
E.g.

A custom NoDublicatesAttribute could be added to enums to prevent multiple in the enum.
A custom NoImplicitValuesAttribute could be added to enums to only allow explicit value assignment the enum.

@alrz
Copy link
Contributor

alrz commented Dec 27, 2016

These are examples of what analyzers can do.

@gafter gafter added Area-Analyzers Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented Feature Request labels Dec 28, 2016
@gafter gafter closed this as completed Dec 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Feature Request 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