Conversation
Problem: Codegen stores the result of an expression the resolver replaced (the builtins ADD, SUB, MUL, DIV, date and time operators, string comparisons) without converting it to the type of the target. `x := t * 1.5` with an LREAL `x` writes the TIME bits into the double and reads 0.0, and `(tod + T#20s)` in parentheses skips the replacement and does not wrap at midnight. Solution: Generate the replacement where every expression value is generated, so the replaced value takes the same conversion to its hint as any other value, also inside parentheses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build Artifacts🐧 Linux
From workflow run 🪟 Windows
From workflow run |
Member
Author
|
Closing in favor of carrying this fix in #1937, which routes the date and time builtins through the same replacement path. |
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.
Problem: Codegen stores the result of an expression the resolver replaced (the builtins
ADD,SUB,MUL,DIV, date and time operators, string comparisons) without converting it to the type of the target.x := t * 1.5with anLREALxwrites theTIMEbits into the double and reads0.0,n := ADD(n, r)stores float bits into aDINT, and(tod + T#20s)in parentheses skips the replacement and does not wrap at midnight. With #1937, the builtin forms such asMUL(t, 1.5)would hit the same path.Solution: Generate the replacement where every expression value is generated. The replaced node already has the type of its replacement, so its value takes the same conversion to its hint as any other value, also inside parentheses.
🤖 Generated with Claude Code