Repository navigation
fix(ts): substitute a census's type parameters into a body once - #263
Conversation
Quest-Claim: ed8b36641efe40d2
Each MIR body is instantiated with its instance's arguments already, but Body substituted a call's generic arguments again. In a census lowered over type parameters, a parameter of the root then took the argument at its index in the body's own instance: a coroutine's kind, `()`. Drop Body's arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # ts/fixtures/reject/census.md
# Conflicts: # ts/fixtures/reject/census.md # ts/fixtures/reject/src/lib.rs
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 417a3fc5d2443b2b16bacec2af2e7aa61f492cd8.
No actionable bugs found in the inspected changes. Removing the second substitution is the simpler, correct boundary: ordinary and coroutine MIR are already instantiated, drop shims instantiate their MIR explicitly, and synthesized dynamic wrappers supply their method arguments directly. Retaining a second substitution with special-case filtering would preserve the underlying ambiguity about which function owns a type parameter.
The generic async census fixture targets the reported failure by carrying an outer function's second parameter through another future and its closure. Keeping the remaining waker-identity and task-cancellation API work separate is appropriate.
Verification limits: GitHub-only static review of substitution removal, affected call/function-value/place paths, MIR construction and the regression fixture, with an independent pass. No builds, tests or census runs were executed; the reported refusal-count improvements and unchanged generated output were not reproduced.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
No actionable comments were generated in the recent review.
|
Problem
moq-net's census refused
kio::Waiter::poll_future::<()>, which "names<() as Future>::Output, which does not normalize". The quest asked where polymorphic lowering makes the().Each MIR body is already instantiated with its instance's arguments (
instance_mir), butBody::call_def,fn_value,std_places, and the&mutpointee check substituted a call's generic arguments again withBody.args. A translation has no parameters left, so the second pass did nothing. A census that lowers a generic function over its own type parameters keeps the root's parameters in every body it reaches, though. In moq-net,ietf::session::run_namespaces<F, O>reaches the closure innamespace_request's async body, whosepoll_future::<O>names the root'sOas#1. Substituting again against the coroutine's own arguments made#1the coroutine's kind type,().Approach
Delete
Body.argsandBody::subst: a body's values are instantiated once, where its MIR is.fixtures/rejectgets a generic async fn awaiting another whose closure names the outer function's second type parameter. Before the fix, its census refusedpoll_pinned::<()>. Now it refuses nothing.Census at the pinned moq revision:
()ones)The model's census refuses no async code. The quest is rewritten to what remains.
Impact
Alternatives
Follow-ups
The quest keeps:
Tasks: translated, it refuses a waker's identity (Waker::dataandWaker::vtablecompared as anOption<(*const (), *const RawWakerVTable)>inPolling, 10 of kio's refusals). Translating it means givingrt.Wakeran identity, which every caller's own waker would then implement, so the shape is the maintainer's call.rt.spawn's shape for callers and cancelling a spawned task, also runtime API.Review
quest review), round 3 on head4ac681273cec010ec999bc327fb80fcb3a5c2ab9: no findings. Rounds 1 (700aa365) and 2 (417a3fc5) also had no findings. Rounds 2 and 3 cover theorigin/mainmerges:fixtures/reject/census.mdwas regenerated and the two blocks appended tofixtures/reject/src/lib.rswere kept, main's first. The quest's mention ofVec::drainwent with the slice-gaps quest, since #259 landed it.fixtures/reject's census, the only census of a rootless crate.Merge of main at
55a0457340f522fe201487581d7c7e50e99fb17e: git merged it without conflicts andjust cipassed on this exact tree; it is a recorded skip, too trivial to review, on top of the clean review of4ac68127.(written by Claude Opus 5.5)
🤖 Generated with Claude Code