Merge train 185r: #10224 #10226 #10228 #10229 #10230 #10231 #10232 - #10242
Merged
Merged
Conversation
added 17 commits
September 14, 2026 00:35
(cherry picked from commit 74b0cd9)
(cherry picked from commit d674d87)
(cherry picked from commit fdbfa69)
(cherry picked from commit d8fd8ba)
(cherry picked from commit 880df62)
(cherry picked from commit ca78777)
(cherry picked from commit 50bed8c)
(cherry picked from commit bb667c5)
(cherry picked from commit 9d37f37)
(cherry picked from commit bcdd462)
…ely (#10222) A class inside a `namespace` block was lowered with `lower_class_decl` and pushed into the module's class table, and nothing else: it was never published as a namespace member (`N.C` read `undefined`), its static field initializers, computed member names, static blocks and legacy decorators never ran, and a call-expression heritage was never registered (`RegisterClassParentDynamic`), so `class Service extends Context.Service<Service, I>()(id) {}` inside a namespace had no parent edge and `Service.of(x)` threw "of is not a function". The namespace arm now mirrors the module-level class declaration path: heritage and computed keys are evaluated first, then static fields/blocks and decorators in declaration order, and exported classes, functions and variables are published as namespace members in source order (so `Object.keys(N)` matches tsc/bun). Namespace-local class names are qualified internally (`NS.C`) with a scope-local alias, so unrelated namespaces can each declare the same class name and sibling functions can reference a class that is declared later; non-exported classes stay usable by sibling functions. Unblocks OpenCode v1.18.30's runtime bootstrap (`packages/core/src/fs-util.ts`, `effect-flock.ts`, `ripgrep/binary.ts`), tracker #10107. Claude-Session: https://claude.ai/code/session_01As1fetJAqDFib4n7Wm5Suo (cherry picked from commit 2e69ca5)
(cherry picked from commit 2a44b61)
(cherry picked from commit 8b5593a)
…espace (#10222) Inside a namespace body an exported function is emitted as a static method of the namespace class, not as a module function. Calls were already redirected to `StaticMethodCall`, but a VALUE reference (`const f = g`, `call(g)`, `Effect.gen(g)`) still lowered to `FuncRef(id)` — a closure over a function that has no module-function body — and calling it returned garbage (`0`, `undefined`, `(number).next is not a function`). The identifier now lowers to the published namespace member, exactly as `NS.g` resolves from outside, which also keeps `g === NS.g`. This was the wall right after the namespace-class fix in OpenCode's `AppRuntime` bootstrap (`next is not a function`). Claude-Session: https://claude.ai/code/session_01As1fetJAqDFib4n7Wm5Suo
This was referenced Sep 14, 2026
This was referenced Sep 14, 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.
Merge train 185r — seven audited PRs cherry-picked onto
main(d8bfa28), plus two train commits and the version bump to 0.5.1563.Train commits:
test(runtime): the new tests from fix: preserve fractional keys in dynamic array reads #10229/fix: read valid fields from wide JSON objects #10230 read handles throughwith_{const,mut}_ptrclosures instead of bareget_raw_*_ptr(their PR CI failed the bareraw_handle_debt.pyrun on exactly this).style: rustfmt fix(hir): lower classes declared inside TypeScript namespaces completely (#10222) #10231's second-commit integration test (namespace_function_values.rs).Local validation (macOS, release, one target pool):
scripts/run_lint_gates.sh: 80/83, the same three steps that fail onmain;check_thread_locals.pyonly main'sregex/perex_owner.rs; raw-handle bare +--no-raise-vs, holders full + self-test, shape census, fmt, file-size pass.cargo test -p perry-hir/-p perry-codegen/-p perry-runtime(RUST_TEST_THREADS=1): pass, except runtime's known release-onlyheap_generation::a_free_or_move_outside_every_scope_is_caught_in_debug_builds(red on main since perf(regex): resume JS-level searches on non-ASCII strings from the previous call's position #10205).namespace_classes,namespace_function_values,issue_10079_script_block_function_hoisting;commands::run::entryunit tests: pass.2899_2779_2777_static_helpers,disposablestack_2875,iterator_prototype_next_patch,gc_http2_pending_event_callback_rooting) plus local-host9574/9592.regex_replace_dyn_regex_with_httpfailed once because a local cleanup job deleted its in-use auto-optimize dir mid-build; re-run separately: PASS.test_issue_1723_require_stdlib_subnamespace, where Node 26.5.1 itself throwsrequire is not defined in ES module scope(oracle side; Perry's output is unchanged).