Inherited arrow-function class field calling this.<other field>() throws 'value is not a function' when the base class is in another module
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust, typescript
- Domain
- compilers
Research direction
Start by reproducing the failure with the supplied base.ts and main.ts examples, then inspect the HIR entry RegisterClassParentDynamic and the compiler’s handling of inherited fields and calls across modules. Done means the Perry example behaves like Node and a regression test covers the cross-module subclass case.
Written by the indexing model from the issue text.
Description
Perry 0.5.1659 (main, 2026-10-18), Linux x86_64.
// base.ts
export class Base {
children?: unknown
addChildren = (c: unknown) => this._add(c)
_add = (c: unknown) => { this.children = c; return this }
}
// main.ts
import { Base } from "./base.ts"
class Sub extends Base { y = 1 }
const r = new Sub()
try { r.addChildren([1]); console.log("ok", r.children) }
catch (e) { console.log("fail", String(e)) }
Node: ok [ 1 ]. Perry: fail TypeError: value is not a function.
- Same code in one file: works.
new Base()(no subclass) across modules: works.- Adding an unrelated read such as
typeof r._addearlier in main.ts makes it pass, so this looks like a whole-program field or call analysis issue. - The HIR shows
RegisterClassParentDynamic { parent_expr: ExternFuncRef { name: "Base" } }for Sub.
This blocks TanStack Router: BaseRoute.addChildren calls this._addFileChildren, and RouterCore has 9 arrow fields that call each other (load, buildLocation, ...), with Router extends RouterCore in another package. SSR of a TanStack Start app then fails with "Objects are not valid as a React child". Related: #12742.
- Dominant language
- Rust
- Stars
- 4.9k
- Forks
- 166
- Avg merge
- 2h 54m
- Merged PRs (30d)
- 922
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PerryTS/perry
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
good first issue gpu serve
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
biomejs/biome#12475 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
documentation E-easy good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 91/100
Maintainers usually reply within 1 day