-
Notifications
You must be signed in to change notification settings - Fork 28.4k
Check bugprone-unchecked-optional-access in Engine clang-tidy. #127701
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
Comments
As I said here, we could also opt in all Impeller components by modifying the |
This check is now enabled in all non-unit test files. Unchecked access is a common pattern in unit tests, and the tests will fail on bad optional accesses, so the lint likely has limited value there. So I'll close this issue as done. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I'm just running into this now in the new DL geometry class tests where I have methods that return optional values. I would be happy if clang-tidy could be taught to recognize |
Meanwhile, I've had good luck with the following macro in my unit test files. I just switch to
|
Yeah, due to this problem, we have the clang-tidy check disabled in most(all?) unit test files. If you have a good way forward, we should get that macro added to a common location, so that we can enable the check in more places. |
There are a number of existing violations to work through (flutter/engine#42281), so we'll have to attack this in two stages:
The text was updated successfully, but these errors were encountered: