Reputation: 15147
Java forces programmer to explicitly specify exceptions raised by methods or provide handlers for them. Is there something similar in Ada language?
Upvotes: 1
Views: 190
Reputation: 594
The only way to do this in Ada is to write a tool to do it for you, see ASIS and libadalang.
Upvotes: 0
Reputation: 6611
Ada does not have exception contracts. The ARG has considered it, and - so far - decided that it isn't worth the effort (AI12-0017-1).
I've seen some cases recently, where it looks like it would be worth the effort.
SPARK (a provable subset/superset of Ada) prevents exceptions completely, so that is an option, but it isn't always feasible to prove absence of all exceptions completely.
Upvotes: 6