Skip to content

Conversation

@cirras
Copy link
Collaborator

@cirras cirras commented May 6, 2025

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).

Copy link
Collaborator

@fourls fourls left a 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?

@cirras cirras force-pushed the best_effort_argument_resolution branch from 60ca97f to 3e19f48 Compare May 7, 2025 01:09
@cirras cirras requested a review from fourls May 7, 2025 01:15
@cirras cirras force-pushed the best_effort_argument_resolution branch 3 times, most recently from 023c1f0 to b337028 Compare May 7, 2025 06:46
cirras added 4 commits May 7, 2025 21:15
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.
@cirras cirras force-pushed the best_effort_argument_resolution branch from 63217c9 to 3b86db8 Compare May 7, 2025 11:30
Copy link
Collaborator

@fourls fourls left a 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:

cirras added 4 commits May 8, 2025 12:39
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.
@cirras cirras force-pushed the best_effort_argument_resolution branch from 3b86db8 to e34166f Compare May 8, 2025 02:39
@cirras cirras requested a review from fourls May 8, 2025 02:39
Copy link
Collaborator

@fourls fourls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🎉

@fourls fourls merged commit c130158 into master May 8, 2025
4 checks passed
@fourls fourls deleted the best_effort_argument_resolution branch May 8, 2025 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants