| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Sorry, something went wrong.
There was a problem hiding this comment.
Captured generic base types can change inherited signatures, causing incorrect weak-type diagnostics.
Review effort: Balanced
Findings: 1
Optimizes weak-type detection to avoid resolving members for generic class/interface instantiations.
Changes:
| File | Description |
|---|---|
| tsc/internal/checker/relater.go | Optimizes isWeakType for type references. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
…eter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
TypeScript Bot (@typescript-bot) test it |
Sorry, something went wrong.
|
Starting jobs; this comment will be updated as builds start and complete.
|
Sorry, something went wrong.
|
Hey Jake Bailey (@jakebailey), it looks like the DT test run failed. Please check the log for more details. |
Sorry, something went wrong.
|
Jake Bailey (@jakebailey)
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing baseline and pr: Everything looks good! |
Sorry, something went wrong.
|
Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing baseline and pr: Everything looks good! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
isWeakType resolves the members of the type it's given. for an instantiation of a generic class or interface that instantiates every declared member and copies in every inherited one, only to check that there are no signatures or index infos and every property is optional. instantiating doesn't change any of that unless a base type is a type parameter (a class declared in a generic function can extend base<T>()), so when none is, this asks the target instead, whose members are resolved once and never instantiated. weakTypeWithTypeParameterBase.ts covers the type parameter case
isRelatedToEx calls isWeakType on the target before it gets to structuredTypeRelatedTo, where two references to the same generic type are compared by variance without looking at members. so an instantiation that's only ever a relation target, and only ever related through its type arguments, still had its whole member table built here
tuple targets are left out. doing the same for them made vscode slightly worse, and tuples are never weak anyway (length is required)
heap after check (Memory used from --extendedDiagnostics), median of 3, same diagnostics with and without this:
on t3code peak rss goes from 5.49 to 4.62 GB with 4 checkers and the symbol count from 11.1M to 7.5M. on the monorepo project peak rss goes from 23.1 to 21.0 GB. check time doesn't get worse anywhere (it's within noise except the monorepo project single threaded, 42.9 → 38.7s)
my guess at why t3code gains the most: effect's api is built from generic interfaces with a lot of members, often through long extends chains (Rpc, the schema Bottom* interfaces, Effect), and every rpc or schema definition is its own instantiation. most checks between them are reference to reference with the same target, which variance answers from the type arguments, so before this the member tables were mostly built just for isWeakType. on t3code's server, 1.02M of the 1.03M instantiated members of Rpc came from this check
t3code is pingdotgg/t3code at 9bd1d800 (effect 4), tsc -p apps/server --noEmit. webpack, xstate-main, vscode, mui-docs and the Compiler cases are the typescript-benchmarking projects
related, avoids these resolutions (and more) by building member tables lazily:
🤖 Generated with Claude Code