Give repeated class evaluations fresh guest constructor identity

Chiusa
#1,964 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #1973 di @nickna — integrata

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, typescript
Ambito
compilers

Direzione di ricerca

Start with constructors-only.ts and tests/fixtures/RepeatedClassEvaluation/, then read docs/plans/repeated-class-evaluation.md when available and inspect the constructor, generic, and property tests named in the issue. Trace repeated evaluation and instance association without emitting new CLR types or using a static current definition. Done means distinct per-evaluation definitions, preserved template identity, matching Node and verified standalone behavior, and passing the listed tests and quality gates.

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

Descrizione

Implement the constructor-definition representation decided by #1906: each evaluation of a class expression creates a fresh guest constructor/definition object while sharing its pre-emitted CLR template. The consolidated #1866 PR will contain docs/plans/repeated-class-evaluation.md and tests/fixtures/RepeatedClassEvaluation/.

The original #1849–#1851 notes omit their exact repeated-evaluation source/deadline. New constructors-only.ts establishes the current mismatch on unchanged 0ad37b57 and 9a431d62: Node/CLI interpretation print false; IL-verified compiled standalone prints true, exit 0. Separate syntax-node tests from #1859 still pass; they do not repair evaluation identity.

Acceptance:

  • Introduce fresh guest definition values per evaluation, retain declaration/template identity for checked compilation metadata, and associate constructed instances with the selected definition before field initialization.
  • Route observable class value equality, new/Reflect construction and required direct constructor paths through the definition; preserve name/arity, prototype/constructor identity and definition-aware instanceof.
  • Cover one syntax node evaluated twice in a function, loop, closure, module and suspended async/generator execution. Distinct definitions remain independent; CLR generic type arguments within one definition keep the same guest constructor/prototype.
  • Match Node for constructors-only and prototype identity controls in both engines and verified standalone output under 30-second deadlines. Keep existing class expression/owner/local class/generic tests passing.
  • Run affected constructor/generic/property tests, Release, quality gates and actual AOT analyzer baseline; report runtime, IL and hosted evidence separately.

Captured computed-key isolation is a separate dependent task. Stop at the definition identity/instance association boundary. Do not emit new CLR types at guest runtime, use a static "current definition", implement arbitrary dynamic heritage (#1907), or expand the frozen #1866 child list. This is a finite implementation transfer, not a claim of repaired behavior.

Lingua principale
C#
Stelle
156
Fork
4
Merge medio
14h 26m
PR unite (30g)
45

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 nickna/SharpTS

Tutte le issue di nickna/SharpTS

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.