Found while fixing #10625 (PR #10634). This fails on current main — it is not caused by that PR, which was
confirmed by reproducing it with the fix stashed against unmodified main.
Repro
class Sink { constructor(...parts) { console.log("P", parts); } }
class Drain extends Sink {}
new Drain("a", "b", "c");
Perry: P [ 'a', 'b', 'c', <5 empty items> ]
Node: P [ 'a', 'b', 'c' ]
A derived class with no own constructor gets an implicit one that forwards to super(...args). When the base
captures a rest parameter, the forwarded array is over-allocated and the trailing slots are left as holes.
It is already covered by a test that nobody sees fail
crates/perry/tests/issue_806_default_derived_ctor_forwarding.rs::walk_into_rest_param_capturing_ctor fails on
main today. Per CLAUDE.md, integration suites under crates/*/tests/*.rs run per-PR only when the diff names
them (e2e-scoped); the sweep/full tiers' cargo test --workspace is the backstop, so a regression there lands
on main and is only attributed by sweep window. That is exactly what appears to have happened here — worth
checking whether this is a regression with an identifiable sweep window, or has been red since the test landed.
Likely related
#10623 — an implicit derived constructor does not forward its arguments to a native base's super() at all
(class NoCtor extends AsyncResource {} throws). This issue is the user-base counterpart: arguments are
forwarded, but the rest array is mis-sized. Both live in implicit-derived-constructor argument forwarding and may
share a root cause; whoever fixes one should check the other.
Found while fixing #10625 (PR #10634). This fails on current
main— it is not caused by that PR, which wasconfirmed by reproducing it with the fix stashed against unmodified
main.Repro
Perry:
P [ 'a', 'b', 'c', <5 empty items> ]Node:
P [ 'a', 'b', 'c' ]A derived class with no own constructor gets an implicit one that forwards to
super(...args). When the basecaptures a rest parameter, the forwarded array is over-allocated and the trailing slots are left as holes.
It is already covered by a test that nobody sees fail
crates/perry/tests/issue_806_default_derived_ctor_forwarding.rs::walk_into_rest_param_capturing_ctorfails onmaintoday. Per CLAUDE.md, integration suites undercrates/*/tests/*.rsrun per-PR only when the diff namesthem (
e2e-scoped); the sweep/full tiers'cargo test --workspaceis the backstop, so a regression there landson
mainand is only attributed by sweep window. That is exactly what appears to have happened here — worthchecking whether this is a regression with an identifiable sweep window, or has been red since the test landed.
Likely related
#10623 — an implicit derived constructor does not forward its arguments to a native base's
super()at all(
class NoCtor extends AsyncResource {}throws). This issue is the user-base counterpart: arguments areforwarded, but the rest array is mis-sized. Both live in implicit-derived-constructor argument forwarding and may
share a root cause; whoever fixes one should check the other.