Repository navigation
feat(ts): map a tail, an argument, and what follows a call to the Rust that made them - #520
Merged
Merged
Conversation
Quest-Claim: 9d169dc2a5aa09f0
…t that made them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… snapshot Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
marked this pull request as ready for review
November 3, 2026 14:25
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
kixelated
enabled auto-merge
November 3, 2026 14:32
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 3, 2026
|
quest land watch: the merge queue removed this pull request at 45354a9 because it conflicts with The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs. (written by quest land watch) |
This was referenced Nov 3, 2026
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.
Completes quest/m3/ts-span-precision.md.
Problem
When
tscrejects translated output, #376 reports the error at the last source-map token before it. The map was coarse:returnmapped to the body's closing}.tscreports a mistyped return at thereturnkeyword.rt.ltand0inunwrapOr(iterMax(iterMap(v, (x) => {...}), rt.lt), 0)mapped into the closure.Approach
new, it isLocatedthere. So an argument made by a call maps to that argument's Rust, and a tail folded intoreturnmaps to the tail expression.returntakes the loc of the tail it returns (held back, or folded fromx = v; return x). The body's end is used only when nothing is held.set_localemits, take their statement's loc.Locatedexpression back to the node that encloses it, and replaces a mapping at the same position instead of adding a second one.Locatednodes require: aLocatedexpression that needed grouping was printed with two pairs of parens (((b as rt.u16)) << 8), and!,&&, and the bitwise grouping checks didn't look throughLocated. The only change to the.tstext is the removal of those redundant parens: 390 snapshot lines, with nothing else changed (checked by diffing each line with parens stripped).Proof: no Rust construct still reaches a real
tscfailure. #375 removed the last one, and I probed about 70 candidates (generic runs atu8, iterators, closures,dyn, async, std mappings) without finding one. So the newspanstest translatesreject/spans.toml, then reruns the driver with a stand-intsconPATH. The stand-in reports an error wheretscreports a mistypedreturn(the keyword) and argument (its start). Those go throughcheck.rsunchanged, andreject/spans.txtsnapshots each reported span, keyed by item, asrejected()does.Measured on moq's codec translation (
moq/ts.toml, pinned rev, release build, 5 alternating runs each):.ts.mapbytes.tsbytesImpact
tscfailures in translated code are finer, as are the source maps. No public API change, so noMIGRATE.mdentry.Alternatives
Spannedspan. This would also map a bare name or an operator argument (such as the receiverminMeter.scaled(m, ...)) to itself. It means wrapping names and operators inLocated, and several passes match on those shapes: wrapping members and binaries changed fold decisions (for examplefmt's spills). Such an argument still maps to the call it is passed to (the method name), which is wheretsc's signature error belongs.v.iter().map(..).sum(), every call would map tov.Choices made without asking: the stand-in
tsctest in place of reject cases from a real typing gap, since none exists; the parens fix in the printer.Follow-ups
None.
Checks
just cipassed locally on 45354a9 (after merging origin/main at b3c1195).Review
mechanical fix by quest land watch:
merged main at 572f8256d34496ed509018e370195f7f8a2a09f1 with the quest merge driver(head 4e3408f)gpt-6.1-sol, medium effort, viaquest review --base origin/main.just cipassed on it.(written by Claude Opus 5.5)
🤖 Generated with Claude Code