Skip to content

Implement class identity, private values, and runtime heritage - #1973

Merged
nickna merged 16 commits into
mainfrom
codex/issues-1961-1968
Oct 7, 2026
Merged

nickna merged 16 commits into
mainfrom
codex/issues-1961-1968

Conversation

@nickna

@nickna nickna commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Fix class declaration and evaluation identity across the checker, interpreter, and emitted runtime. Repeated class factories now produce independent guest constructors, prototypes, captured keys, environments, and static initialization. Namespace owners remain distinct, generic constructor assignments use checked structural compatibility, and inline prototype queries emit verifiable IL.

Add canonical unbound private-method values and lexical private-in brand checks, including generic owners, closures, suspension, module ownership, and field installation timing. Runtime-valued heritage retains the selected ordinary user-class parent and dispatches construction, inherited members, super calls, and instanceof on the original child receiver.

Each issue has its own implementation commit; subsequent verification fixes are separate commits. The retained investigation fixtures and design documents record reference outputs, bounded scope, deployment behavior, and conformance limits.

Validation:

  • Release solution build and code-quality gate pass (27 duplicate groups, zero errors).
  • Actual analyzer-aware AOT/trim/single-file restore and rebuild match the unchanged zero-warning baseline.
  • Pinned TypeScript 6.0.3 checker smoke gate passes all 32 corpus cases.
  • Private-in CLI matrix passes 28 bounded processes against Node, including verified standalone output and hosted initialization with default declarations and --noLib. Targeted feature tests separately verify serialized IL and runtime output.
  • A separate direct-RHS probe passes Node, interpretation, saved-IL verification and standalone execution under 30-second deadlines; it checks one evaluation on successful, primitive, abrupt and wrong-object operands.
  • Full hermetic suite: 26,825 passed, 3 skipped, zero failed — core 24,464 passed/3 skipped, GUI 134 passed, and three standalone shards 2,227 passed. The final core rerun includes the corrected class-helper selection contract in hosted and standalone modes.

The pinned private-in Test262 selection improves eight cases per engine, with no regressions; three existing parser gaps and eight deferred negatives remain explicitly recorded. The separate private-method selection improves one case per engine without regressions. These bounded selections do not claim full Test262 conformance or Native AOT publication. Dynamic heritage remains limited to the documented ordinary emitted user-class adapter boundary.

CI watch: the first Windows run hit the existing PromiseMethodTests.All_ResultAssimilatesArrayPrototypeThen empty-output race. Controlled continuation starvation reproduces the same output on unchanged main (0b6f5179) and this branch; the failed-job retry passed. Both CI and Desktop GUI gates are green on the final commit. An independent captured-class-return arrow control also retains the same IL-verifier failure on main and this branch, and is outside the finite feature scope. Neither baseline control is credited as a pass.

CodeRabbit skipped automated review because the consolidated 135-file change exceeds its 100-file limit and available review capacity.

Fixes #1961
Fixes #1962
Fixes #1963
Fixes #1964
Fixes #1965
Fixes #1966
Fixes #1967
Fixes #1968

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 135 files, which is 35 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 45ba094c-e133-4b50-b60f-20f53a831c95
📥 Commits

Reviewing files that changed from the base of the PR and between 0b6f517 and 3b005ca.

📒 Files selected for processing (135)
  • docs/plans/generic-constructor-compatibility.md
  • docs/plans/namespace-class-identity.md
  • docs/plans/private-in-brand-checks.md
  • docs/plans/private-method-values.md
  • docs/plans/repeated-class-evaluation.md
  • docs/plans/runtime-valued-superclass.md
  • eng/CodeQuality/duplicates.json
  • src/SharpTS/Compilation/AsyncGeneratorMoveNextEmitter.Expressions.cs
  • src/SharpTS/Compilation/AsyncGeneratorMoveNextEmitter.Variables.cs
  • src/SharpTS/Compilation/AsyncMoveNextEmitter.ArrowFunctions.cs
  • src/SharpTS/Compilation/AsyncMoveNextEmitter.Operators.cs
  • src/SharpTS/Compilation/AsyncMoveNextEmitter.cs
  • src/SharpTS/Compilation/CallHandlers/ClassExprStaticHandler.cs
  • src/SharpTS/Compilation/CallHandlers/SuperConstructorHandler.cs
  • src/SharpTS/Compilation/CallHandlers/ThisStaticContextHandler.cs
  • src/SharpTS/Compilation/ClassExpressionFactory.cs
  • src/SharpTS/Compilation/ClosureAnalyzer.cs
  • src/SharpTS/Compilation/CompilationContext.ClassExpressions.cs
  • src/SharpTS/Compilation/CompilationContext.Classes.cs
  • src/SharpTS/Compilation/EmittedClassDefinitionRuntime.cs
  • src/SharpTS/Compilation/EmittedRuntime.cs
  • src/SharpTS/Compilation/ExpressionEmitterBase.CallHelpers.cs
  • src/SharpTS/Compilation/ExpressionEmitterBase.ClassDefinitions.cs
  • src/SharpTS/Compilation/ExpressionEmitterBase.Operators.cs
  • src/SharpTS/Compilation/ExpressionEmitterBase.PrivateGenerics.cs
  • src/SharpTS/Compilation/ExpressionEmitterBase.PrivateIn.cs
  • src/SharpTS/Compilation/ExpressionEmitterBase.PrivateMethodValues.cs
  • src/SharpTS/Compilation/ExpressionEmitterBase.cs
  • src/SharpTS/Compilation/ILCompiler.ArrowFunctions.cs
  • src/SharpTS/Compilation/ILCompiler.Async.cs
  • src/SharpTS/Compilation/ILCompiler.AsyncGenerators.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.Accessors.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.ClassExpressions.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.Constructors.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.DefinitionInitialization.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.DefinitionMethodValues.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.Definitions.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.HasFields.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.Methods.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.PrivateMethodValues.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.Prototypes.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.RuntimeParents.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.Static.cs
  • src/SharpTS/Compilation/ILCompiler.Classes.cs
  • src/SharpTS/Compilation/ILCompiler.ContextFactories.cs
  • src/SharpTS/Compilation/ILCompiler.Generators.cs
  • src/SharpTS/Compilation/ILCompiler.IteratorStubs.cs
  • src/SharpTS/Compilation/ILCompiler.Namespaces.cs
  • src/SharpTS/Compilation/ILCompiler.State.cs
  • src/SharpTS/Compilation/ILCompiler.cs
  • src/SharpTS/Compilation/ILEmitter.Calls.Closures.cs
  • src/SharpTS/Compilation/ILEmitter.Calls.Constructors.cs
  • src/SharpTS/Compilation/ILEmitter.Calls.cs
  • src/SharpTS/Compilation/ILEmitter.EventEmitterFacade.cs
  • src/SharpTS/Compilation/ILEmitter.Expressions.cs
  • src/SharpTS/Compilation/ILEmitter.Namespaces.cs
  • src/SharpTS/Compilation/ILEmitter.Operators.cs
  • src/SharpTS/Compilation/ILEmitter.Properties.Private.cs
  • src/SharpTS/Compilation/ILEmitter.Properties.cs
  • src/SharpTS/Compilation/ILEmitter.Statements.cs
  • src/SharpTS/Compilation/NestedFunctionLifter.cs
  • src/SharpTS/Compilation/ParameterTypeResolver.cs
  • src/SharpTS/Compilation/PrivateClassElementRegistry.cs
  • src/SharpTS/Compilation/Registries/ClassRegistry.cs
  • src/SharpTS/Compilation/RuntimeEmitter.ClassCaptures.cs
  • src/SharpTS/Compilation/RuntimeEmitter.ClassDefinition.RuntimeParents.cs
  • src/SharpTS/Compilation/RuntimeEmitter.ClassDefinition.cs
  • src/SharpTS/Compilation/RuntimeEmitter.DynamicConstruct.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Functions.NewOp.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Functions.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Iterator.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Objects.Index.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Objects.Properties.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Objects.Prototype.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Objects.SetProperty.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Operators.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Reflect.cs
  • src/SharpTS/Compilation/RuntimeEmitter.RuntimeClass.cs
  • src/SharpTS/Compilation/RuntimeEmitter.Symbols.cs
  • src/SharpTS/Compilation/RuntimeEmitter.cs
  • src/SharpTS/Compilation/RuntimeFeatureDetector.cs
  • src/SharpTS/Compilation/RuntimeFeatureSet.cs
  • src/SharpTS/Compilation/StatementEmitterBase.cs
  • src/SharpTS/Compilation/TypeMapper.cs
  • src/SharpTS/Execution/Interpreter.Calls.cs
  • src/SharpTS/Execution/Interpreter.ClassInitializers.cs
  • src/SharpTS/Execution/Interpreter.Dispatch.cs
  • src/SharpTS/Execution/Interpreter.Expressions.cs
  • src/SharpTS/Execution/Interpreter.Namespaces.cs
  • src/SharpTS/Execution/Interpreter.PrivateIn.cs
  • src/SharpTS/Execution/Interpreter.Properties.cs
  • src/SharpTS/Execution/Interpreter.Statements.cs
  • src/SharpTS/Execution/Interpreter.cs
  • src/SharpTS/Parsing/AST.cs
  • src/SharpTS/Parsing/GeneratorArrowLifter.cs
  • src/SharpTS/Parsing/Parser.Expressions.cs
  • src/SharpTS/Parsing/Parser.ForInitializerValidation.cs
  • src/SharpTS/Parsing/Parser.Statements.cs
  • src/SharpTS/Parsing/Visitors/AstNodeCatalog.cs
  • src/SharpTS/Parsing/Visitors/AstVisitorBase.cs
  • src/SharpTS/Runtime/RuntimeEnvironment.cs
  • src/SharpTS/Runtime/Types/SharpTSAsyncFunction.cs
  • src/SharpTS/Runtime/Types/SharpTSAsyncGeneratorFunction.cs
  • src/SharpTS/Runtime/Types/SharpTSClass.cs
  • src/SharpTS/Runtime/Types/SharpTSFunction.cs
  • src/SharpTS/Runtime/Types/SharpTSGeneratorFunction.cs
  • src/SharpTS/TypeSystem/ControlFlow/LoopAssignmentAnalyzer.cs
  • src/SharpTS/TypeSystem/TypeChecker.Compatibility.GenericConstructors.cs
  • src/SharpTS/TypeSystem/TypeChecker.Compatibility.cs
  • src/SharpTS/TypeSystem/TypeChecker.Dispatch.cs
  • src/SharpTS/TypeSystem/TypeChecker.Expressions.cs
  • src/SharpTS/TypeSystem/TypeChecker.PrivateIn.cs
  • src/SharpTS/TypeSystem/TypeChecker.Properties.cs
  • src/SharpTS/TypeSystem/TypeChecker.Statements.Classes.Stages.cs
  • src/SharpTS/TypeSystem/TypeChecker.Statements.Classes.cs
  • src/SharpTS/TypeSystem/TypeChecker.StrictPropertyInitialization.cs
  • src/SharpTS/TypeSystem/TypeChecker.cs
  • src/SharpTS/TypeSystem/TypeMap.cs
  • tests/SharpTS.Tests/Compilation/EmitterSyncTests.cs
  • tests/SharpTS.Tests/CompilerTests/ClassRuntimeFeatureGatingTests.cs
  • tests/SharpTS.Tests/CompilerTests/EmittedClassDefinitionRuntimeTests.cs
  • tests/SharpTS.Tests/CompilerTests/PrivateClassElementRegistryTests.cs
  • tests/SharpTS.Tests/ParserTests/PrivateInParserTests.cs
  • tests/SharpTS.Tests/SharedTests/EventsClassStaticIdentityTests.cs
  • tests/SharpTS.Tests/SharedTests/GenericConstructorCompatibilityTests.cs
  • tests/SharpTS.Tests/SharedTests/InlineConstructorPrototypeTests.cs
  • tests/SharpTS.Tests/SharedTests/NamespaceClassIdentityTests.cs
  • tests/SharpTS.Tests/SharedTests/PrivateInTests.cs
  • tests/SharpTS.Tests/SharedTests/PrivateMethodValueTests.cs
  • tests/SharpTS.Tests/SharedTests/RepeatedClassAsyncGeneratorCaptureTests.cs
  • tests/SharpTS.Tests/SharedTests/RepeatedClassDefinitionTests.cs
  • tests/SharpTS.Tests/SharedTests/RepeatedClassStateTests.cs
  • tests/SharpTS.Tests/SharedTests/RuntimeSuperclassTests.cs
  • tests/fixtures/PrivateIn/README.md
  • tests/fixtures/RepeatedClassEvaluation/prototype-separate-values.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nickna
nickna merged commit 2beb573 into main Oct 7, 2026
48 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment