Opened 5 years ago
Closed 4 years ago
#173 closed defect (fixed)
Catch Declaration not Seen by Condition (New AST only)
Reported by: | ajbeach | Owned by: | |
---|---|---|---|
Priority: | major | Component: | cfa-cc |
Version: | 1.0 | Keywords: | |
Cc: |
Description
There is a bug where the declaration of a catch clause is not in scope when resolving the condition. This means the condition can't use the exception that has been caught to decide whether or not to handle it. A common use case.
The old AST has a rather messy fix that rewrites the catch statement into an encoded form and then undoing the operation before passing it onto another pass. However this doesn't work for the new AST and a different solution will be needed.
Note: See
TracTickets for help on using
tickets.
We need mutates which could introduce a few extra clones (theoretically two per confrontational catch but more likely 0 or 1) but other than that I think issue mentioned was something the new ast actually does support. Its still a kind of messy operation but it works.