Avoid inconsistent implicit toString on potential string subtypes#21318
Draft
Avoid inconsistent implicit toString on potential string subtypes#21318
toString on potential string subtypes#21318Conversation
Fix cases where the compiler cannot prove types don't extend string: 1. FileSystem.qll: Add toString() to ContainerBase signature. The instantiation sites already provide toString(), so no changes needed there. Container.toString() now delegates to super.toString(). No behaviour change. 2. DataFlowImplCommon.qll: Content.toString() now delegates to super.toString() instead of returning the literal "Content". This is a behaviour change: Content now displays its actual description (e.g. field names) rather than the generic "Content".
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.
Fix cases where the compiler cannot prove types don't extend string:
FileSystem.qll: Add
toString()to ContainerBase signature. The instantiation sites already provide toString(), so no changes needed there.Container.toString()now delegates tosuper.toString(). No behaviour change.DataFlowImplCommon.qll:
Content.toString()now delegates tosuper.toString()instead of returning the literal"Content". This is a behaviour change: Content now displays its actual description (e.g. field names) rather than the generic"Content".