Skip to content

fix(hy-check): reject variadic spread on non-variadic encoding/hex and time duration calls (fixes #4308) - #4309

Open
Mekdou23 wants to merge 1 commit into
limitlessprojects:mainfrom
Mekdou23:fix/hex-time-spread-4308
Open

Mekdou23 wants to merge 1 commit into
limitlessprojects:mainfrom
Mekdou23:fix/hex-time-spread-4308

Conversation

@Mekdou23

@Mekdou23 Mekdou23 commented Nov 9, 2026

Copy link
Copy Markdown

Fixes #4308

Summary

Extends the inline encoding/hex (#4238) and time.{milliseconds,seconds,minutes,hours} call checks in compiler/crates/hy-check/src/buildable.rs with the same spread-first if args.iter().any(|a| a.spread) guard landed in #4271 and #4273 (GUARANTEES.md Row 13 BUILDABLE):

  • Rejects variadic spread (...) on all 10 non-variadic encoding/hex functions (encode, encode_to_string, decode_string, dump, dumper, encoded_len, decoded_len, new_encoder, new_decoder, decode) with HYB-E1002.
  • Rejects variadic spread (...) on time.milliseconds, time.seconds, time.minutes, and time.hours with HYB-E1002, while keeping all non-spread numeric calls accepted.
  • Pure test additions in compiler/crates/hy-check/tests/hex_member_arity_buildable_4085.rs (hex_non_variadic_spread_rejected_e1002 and time_duration_constructors_reject_variadic_spread_e1002).

Verification

  • cargo test -p hy-check --test hex_member_arity_buildable_4085 (8 passed; 0 failed)

…d time duration calls (fixes limitlessprojects#4308)

Convert the inline `encoding/hex` and `time.{milliseconds,seconds,minutes,hours}`
arity guards in `buildable.rs` into spread-first `else if` checks matching the
landed limitlessprojects#4271 / limitlessprojects#4273 idiom so `hex.encode_to_string(xs...)`, `hex.decode(dst, xs...)`,
and `time.seconds(ns...)` fail closed with HYB-E1002 instead of escaping to `go build`.
@github-actions github-actions Bot added the bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify()) label Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:land-candidate Shepherd: fresh, gate-clean, verifiable (set from classify())

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[soundness] hy-check(buildable): variadic spread (...) accepted on non-variadic encoding/hex and time duration constructor calls (HYB-E1002, Row 13)

1 participant