Repository navigation
fix(hy-check): reject shadowed strings/http in httptest.get/post and E11 ? propagation (fixes #3789) - #3793
Conversation
2ed2313 to
1f38572
Compare
…E11 ? propagation (fixes limitlessprojects#3789)
1f38572 to
58ae606
Compare
Landed in
|
The #3793 merge commit (30e7513) carried the PR's incidental encoding damage: 10 doc-comment arrows (8 x U+2192, 2 x U+2194) had been replaced with literal ? and a stray blank line was appended at EOF. The intended in-merge restoration was written to the worktree but not staged before the merge committed, so the damage shipped. This commit restores all 10 comment lines byte-identical to their pre-merge state and drops the EOF blank line. Code semantics unchanged (comments only); the #3793 check block and test suite are untouched. CREDIT: @bradwue313 (the #3793 fix itself; this is a drain-side fixup)
|
Correction to the landing note above (Session 129 drain, 2026-11-07): The merge commit Evidence claims in the landing note (merge gate CLEAN, 457 suites, corpus 135/135 tripwire clean, differential 45/45 + 90/90 FULL AGREEMENT) remain accurate; the net-diff note now reads: merge commit carried your fix + the comment noise, |
…ing calls (E3/E4, fixes #3793-family operand half) (RPMFAN) try_context.rs: new check_try_operand closes the E3 "calls only" / E4 operand half — `?` postfix on a non-call (`1?`, `x.f?`, `none?`), a call whose known results do not end in error, and calls returning option[T] (is_option_type via resolve_type_alias) all reject HYB-E2011 at the operand span; unresolved/foreign/locally-shadowed callees stay fail-open (owned by emit/other passes). fn_decl_type_param_names helper extracted (same Decl::Fn collection reused by fnlit walk). New suite pins rejects + positive controls. Verification (trial-merge worktree vs main @ d96b7a9): merge-gate CLEAN; cargo test --workspace 459 suites ok; corpus 135/135 tripwire not fired; differential 45/45 accept + 90/90 reject FULL AGREEMENT. CREDIT: @RPMFAN
Fixes #3789
Summary
Under GUARANTEES.md Row 13 (BUILDABLE), any program accepted by
hyb checkmust emit Go code that compiles undergo build.Following #3598 / #3727:
httptest.getandhttptest.postlowering (compiler/crates/hy-emit/src/stmt.rs:1244-1267):code, body := httptest.get(mux, path)?andhttptest.post(mux, path)?lower tohttp.NewRequest(...)andstrings.TrimSuffix(...). Whenstringsorhttpis shadowed by an in-scope parameter, local binding, type parameter, or package-level declaration, emitted Go fails downstreamgo build(strings.TrimSuffix undefined/http.NewRequest undefined).http.handler?propagation (compiler/crates/hy-emit/src/stmt.rs:1118-1126, 1183-1188):Inside an
http.handlerclosure,?lowers tohttp.Error(<w>, hyErr.Error(), http.StatusBadRequest). Whenhttpor the response writer parameter<w>is shadowed inside the closure body at the?site, emitted Go fails downstreamgo build.Fix
compiler/crates/hy-check/src/buildable.rs: checkself.is_pkg_symbol_shadowed("strings")andself.is_pkg_symbol_shadowed("http")onhttptest.getandhttptest.postcalls, emittingHYB-E1002.compiler/crates/hy-check/src/try_context.rs: track the active E11 handler writer parameter (e11_writer: Option<(String, usize)>) and emitHYB-E1002when?is evaluated inside an E11 handler closure whilehttpor the writer parameter is shadowed in an enclosing scope.compiler/crates/hy-check/tests/shadowed_httptest_and_e11_handler_3789.rs(5 negative reject controls + positive accept control).Payout Wallet (USDC on Base):
0x38e0f40371be8b30f0909f890a1f701a25cd30cd