Uh oh!
There was an error while loading. Please reload this page.
Attach the deprecation version to the deprecating call - #277
Open
sirreal wants to merge 1 commit into
Open
Conversation
`export_uses()` wrote `deprecation_version` to `$out['functions'][0]`, the first recorded function use, instead of the `_deprecated_*()` call that carries the version. That only looked correct when the deprecating call happened to be the first call in the scope, as it is in a deprecated file; whenever another call precedes it, the version was attached to that unrelated call and the deprecating call got none. Build the use record first and attach the version to it before appending. Found during the review of #262 and extracted here as a standalone change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
export_uses()writesdeprecation_versionto$out[ $type ][0]— the first recorded function use — instead of the_deprecated_function()record it belongs to. Any function whose deprecated-call is not the first call in the body exports the version on the wrong record:exports
uses.functions[0] = { name: 'do_something_first', …, deprecation_version: '6.1.0' }while the_deprecated_functionrecord gets none. It only looks correct in existing fixtures because the deprecated-call happens to come first.Build the record locally, attach the version to it, and append it once — no positional indexing. The test was added first and fails on master with the version on the wrong entry.
Found during the review of #262 and extracted here as a standalone change.
🤖 Generated with Claude Code