Skip to content

Compare callables, not ranges, when relating duplicate functions - #1869

Merged
TwitchBronBron merged 2 commits into
v1from
duplicate-function-compare-callables
Oct 5, 2026
Merged

TwitchBronBron merged 2 commits into
v1from
duplicate-function-compare-callables

Conversation

@TwitchBronBron

Copy link
Copy Markdown
Member

The duplicate-function diagnostic skips "itself" when listing the other declarations by comparing nameRange objects by reference. That only works because BrsFile caches its callables, and it would quietly break if the ranges were ever rebuilt (as they are once locations are computed on demand in #1845). Compare the callables directly instead.

Verified with npm run test:nocover. The new test passes on v1 either way; it guards the behavior.

🤖 Generated with Claude Code

TwitchBronBron and others added 2 commits October 2, 2026 16:17
The duplicate-function diagnostic skipped "itself" by comparing nameRange objects by reference. That only works because BrsFile caches its callables. Compare the callables directly instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@TwitchBronBron
TwitchBronBron marked this pull request as ready for review October 5, 2026 18:35
@TwitchBronBron
TwitchBronBron enabled auto-merge (squash) October 5, 2026 18:39
@TwitchBronBron
TwitchBronBron merged commit 2ae472d into v1 Oct 5, 2026
11 checks passed
@TwitchBronBron
TwitchBronBron deleted the duplicate-function-compare-callables branch October 5, 2026 18:46
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.

1 participant