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

Should check and warn if an action type is not annotated with ActionTypeAttribute #28

dahlia opened this issue Jan 7, 2019 · 1 comment


None yet
1 participant
Copy link

commented Jan 7, 2019

It currently crashes without any warning or meaningful error message if an action type is not annotated with ActionTypeAttribute. This behavior can confuse library users whether they are aware that an action should be annotated with the attribute and just miss it or not aware of it at all.

  • We should makeBlockchain<T> to throw a runtime exception (e.g., InvalidActionTypeException) with a well-guided error message if T is not annotated with the attribute.
  • We could write a small Roslyn Analyzer so that this situation is warned at compile-time.

(Reported by @ipdae.)


This comment has been minimized.

Copy link
Member Author

commented May 27, 2019

Since the patch #169, ActionTypeAttribute has been no more used by all IAction implementations, but only actions used with PolymorphicAction<T>. Currently, a MissingActionTypeException is thrown when an action type which lacks ActionTypeAttribute is passed to PolymorphicAction<T> class. This issue is not closed because we don't have a Roslyn Analyzer to detect this at compile-time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.