Skip to content

Conversation

@IanKemp
Copy link

@IanKemp IanKemp commented Feb 19, 2019

Introduces two new analyzers:

  • RCS1235 that detects and notifies when an enum is being cast from a numeric value, instead of referencing the corresponding enum field
  • RCS1236 that detects and warns when an enum is being cast from a numeric value that doesn't exist in the enum

and a codefix and refactoring for RCS1235.

This is not my first time playing with Roslyn and syntax trees, but it is my first time doing it "seriously" in the hopes that the result will be useful to others, so please be gentle. In particular, I'm not sure what the best/correct diagnostic category to use is, and of course I'm sure there are more efficient/more correct ways to achieve what I want to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants