-
Notifications
You must be signed in to change notification settings - Fork 26
Implement best-effort resolution of arguments to unresolved invocables #377
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
Conversation
fourls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since name resolution issues are now much better hidden, should there be a debug-level log message when a name fails to be resolved?
60ca97f to
3e19f48
Compare
023c1f0 to
b337028
Compare
Property specifiers `read`/`write`/`implements`/`stored` were being resolved twice, which was unnecessary because they should be resolved as part of the top-level resolution of the `PropertyNode`. In a funny twist, it turns out we were actually relying on that second visit to resolve non-invocable expressions in `read`/`write`/`stored` specifiers. This is now handled properly in the top-level resolve.
63217c9 to
3b86db8
Compare
fourls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good and will be a particularly helpful addition. The name resolution logging is also a great debugging improvement.
I have a couple of minor comments:
...hi-checks/src/test/java/au/com/integradev/delphi/checks/VariableInitializationCheckTest.java
Show resolved
Hide resolved
delphi-frontend/src/test/resources/au/com/integradev/delphi/symbol/typeResolution/Pointers.pas
Outdated
Show resolved
Hide resolved
These failures weren't important to the tests, but it's best for this code to be as well-formed as possible. Plus, it helped in identifying cases where we were logging name resolution failures erroneously.
This test was low-value and full of name resolution failures. The testing surface for simple symbol resolution is well-covered by the other 148 tests in this suite.
Delphi allows unresolved bare inherited expressions, and even generates them in event handlers. Logging them would be useless noise.
3b86db8 to
e34166f
Compare
fourls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🎉
This PR implements best-effort name resolution for arguments in cases where the associated invocable could not be resolved.
It improves analysis quality in cases where symbol information is incomplete (whether due to misconfiguration or analyzer flaw).