Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Inherited arrow-function class field calling this.<other field>() throws 'value is not a function' when the base class is in another module

Aperta
#12,818 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, typescript
Ambito
compilers

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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._add earlier 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.

Lingua principale
Rust
Stelle
4.9k
Fork
166
Merge medio
2h 54m
PR unite (30g)
922

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PerryTS/perry

Tutte le issue di PerryTS/perry

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.