Repository navigation
[2.1.0] Rewrite .to_s/.to_i/.to_f only as whole words - #22
Open
OffgridwithJD wants to merge 1 commit into
Open
OffgridwithJD wants to merge 1 commit into
OffgridwithJD wants to merge 1 commit into
Conversation
The shared rewriter turned '.to_' plus i, s or f into a cast wherever it appeared, so a field named to_status became r::texttatus (and to_s_name r::text_name). The suffix must now end the word. 'x.to_s()' drops the empty argument list with the method name instead of leaving '::text()'. Reported by the plxcsharp front end's review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
The shared expression rewriter turned
.to_followed byi,sorfinto a cast wherever it appeared, so a field whose name starts with one of them broke:r.to_statusr::texttatus(type "texttatus" does not exist)r.to_statusr.to_s_namer::text_namer.to_s_namen.to_s()n::text()(syntax error)n::textThe rewrite now applies only when the suffix ends the word. An empty argument list after it is dropped along with the method name. This affected every dialect that uses the shared rewriter. The
.to_s,.to_iand.to_fforms themselves are unchanged.The plxcsharp front end's review found this.
Testing
make installcheck: all 13 suites pass on PG 18.4. CI covers 13 to 18.make differentialcheck: 0 unexplained.plx_featurescase readsto_status,to_s_nameandto_itemsfields alongsiden.to_s,n.to_s(),'4.5'.to_fand'12'.to_i + 1.Code-only, so no
ALTER EXTENSIONis needed.🤖 Generated with Claude Code