You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IagoAbal
changed the title
scala: Not trivial to write a pattern to match a try-catch
scala: Cannot write a pattern to match every try-catch
May 16, 2023
## What:
This PR makes it so you can put an ellipsis inside of a `catch { }`, as
a valid pattern.
## Why:
This makes it so you can now write a pattern which matches every kind of
`try-catch`, which SR would like to do.
## How:
Just translated a `catch { ... }` into a catch clause with an ellipsis
pattern and ellipsis body, which matches everything.
## Test plan:
`make test`
Closes#7807
PR checklist:
- [X] Purpose of the code is [evident to future
readers](https://semgrep.dev/docs/contributing/contributing-code/#explaining-code)
- [X] Tests included or PR comment includes a reproducible test plan
- [X] Documentation is up-to-date
- [X] A changelog entry was [added to
changelog.d](https://semgrep.dev/docs/contributing/contributing-code/#adding-a-changelog-entry)
for any user-facing change
- [X] Change has no security implications (otherwise, ping security
team)
If you're unsure about any of this, please see:
- [Contribution
guidelines](https://semgrep.dev/docs/contributing/contributing-code)!
- [One of the more specific guides located
here](https://semgrep.dev/docs/contributing/contributing/)
The pattern I tried to write at first doesn't work: https://semgrep.dev/s/E24L
This works https://semgrep.dev/s/7Rve but it's not very flexible, it doesn't allow you to match every try-catch.
What is the priority of the bug to you?
The text was updated successfully, but these errors were encountered: