Repository navigation
Fix field renames after external class data writes - #901
Open
yangfan-yf-yf wants to merge 2 commits into
Open
yangfan-yf-yf wants to merge 2 commits into
yangfan-yf-yf wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #901 +/- ##
==========================================
+ Coverage 95.34% 95.39% +0.04%
==========================================
Files 134 136 +2
Lines 26762 27843 +1081
==========================================
+ Hits 25516 26560 +1044
- Misses 1246 1283 +37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3 tasks done
This branch has not been deployed
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 free
to 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.
Description
After
Box.slot = Value(), renamingValue.fieldcan leaveBox.slot.fieldunchanged and break execution. I track a single unconditional module-level data assignment when both classes are defined in the same module with unique bindings, including replacement of an existing attribute. I preserve the original import source identity separately from the replacement attribute value.I reject affected renames before producing changes when earlier reads, rebinding, repeated or conditional writes, inheritance, or lookup hooks make the value uncertain. Callable and descriptor assignments, general dynamic/factory inference, and arbitrary containers remain outside this support.
I added regression controls for imported factories, module aliases and cycles, nested classes, namespace modules, Unicode import offsets, and local pattern/exception/unpacking rebinding. A potentially affected field rename must preserve execution or refuse changes atomically; an unrelated global rename and an ordinary referenced field rename must still succeed.
I validated the current change locally:
Checklist