Repository navigation
Scan other files for uses of System Rules fields before migrating them - #1310
Merged
Merged
Conversation
…temStubs` and `SystemPropertyRulesToPioneer`
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.
What changed
SystemRulesToSystemStubsandSystemPropertyRulesToPioneerdecided whether a rule field "may be used elsewhere" only from the owner being abstract or the file being inmain. A concreteBaseTestwhoseoutrule is read by aSubTestin another file was retyped (System Stubs) or removed (Pioneer), andSubTeststopped compiling.Both recipes are now
ScanningRecipes. The scanner records, perowner#field, the source files that reference the field. A non-private rule field referenced from a file other than its declaring file is treated as used elsewhere, so System Stubs adds the existingTODO Migrate by handcomment and Pioneer leaves the rule alone.Why a scan rather than only the TODO
Scanning is feasible here: it is a cheap identifier pass, and it avoids flagging every concrete class. The abstract/
mainheuristics stay as the fallback for subclasses outside the repository.ExpectedSystemExitToCatchSystemExitsharesSystemRules.mayBeUsedElsewhereand keeps its previous behaviour through an overload; it is not part of this item.Tests
Regression tests with a base class and a subclass in separate files, for each recipe; both fail without the change.
Fixes item B6 of #1211.