| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
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 Isabel Duan (@iisaduan), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so: {
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/162857/artifacts?artifactName=tgz&fileId=44CAF8D1A815E861B024867349A1BA4D64F7A3FF9ADC7FD310912E8F233464F902&fileName=/typescript-5.6.0-insiders.20240719.tgz"
}
}
and then running npm install. There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.6.0-pr-59352-2".; |
Sorry, something went wrong.
|
Hey Isabel Duan (@iisaduan), the results of running the DT tests are ready. Everything looks the same! |
Sorry, something went wrong.
|
Isabel Duan (@iisaduan) Here are the results of running the user tests with tsc comparing main and refs/pull/59352/merge: Everything looks good! |
Sorry, something went wrong.
|
Isabel Duan (@iisaduan)
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
Isabel Duan (@iisaduan) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59352/merge: Something interesting changed - please have a look. Detailsag-grid/ag-grid31 of 110 projects failed to build with the old tsc and were ignored enterprise-modules/viewport-row-model/tsconfig.watch.json
enterprise-modules/viewport-row-model/tsconfig.types.watch.json
enterprise-modules/status-bar/tsconfig.watch.json
enterprise-modules/status-bar/tsconfig.types.watch.json
enterprise-modules/sparklines/tsconfig.watch.json
enterprise-modules/sparklines/tsconfig.types.watch.json
enterprise-modules/side-bar/tsconfig.watch.json
enterprise-modules/side-bar/tsconfig.types.watch.json
enterprise-modules/set-filter/tsconfig.watch.json
enterprise-modules/set-filter/tsconfig.types.watch.json
enterprise-modules/server-side-row-model/tsconfig.watch.json
enterprise-modules/server-side-row-model/tsconfig.types.watch.json
enterprise-modules/row-grouping/tsconfig.watch.json
enterprise-modules/row-grouping/tsconfig.types.watch.json
enterprise-modules/rich-select/tsconfig.watch.json
enterprise-modules/rich-select/tsconfig.types.watch.json
enterprise-modules/range-selection/tsconfig.watch.json
enterprise-modules/range-selection/tsconfig.types.watch.json
enterprise-modules/multi-filter/tsconfig.watch.json
enterprise-modules/multi-filter/tsconfig.types.watch.json
enterprise-modules/master-detail/tsconfig.watch.json
enterprise-modules/master-detail/tsconfig.types.watch.json
enterprise-modules/filter-tool-panel/tsconfig.watch.json
enterprise-modules/filter-tool-panel/tsconfig.types.watch.json
enterprise-modules/core/tsconfig.watch.json
enterprise-modules/core/tsconfig.types.watch.json
enterprise-modules/advanced-filter/tsconfig.watch.json
enterprise-modules/advanced-filter/tsconfig.types.watch.json
community-modules/vue3/tsconfig.watch.json
community-modules/vue3/tsconfig.types.watch.json
community-modules/infinite-row-model/tsconfig.watch.json
community-modules/infinite-row-model/tsconfig.types.watch.json
community-modules/csv-export/tsconfig.watch.json
community-modules/csv-export/tsconfig.types.watch.json
community-modules/core/tsconfig.watch.json
community-modules/core/tsconfig.types.watch.json
community-modules/client-side-row-model/tsconfig.watch.json
community-modules/client-side-row-model/tsconfig.types.watch.json
compiler-explorer/compiler-explorer2 of 6 projects failed to build with the old tsc and were ignored tsconfig.tests.json
tsconfig.json
static/tsconfig.json
desktop/desktop1 of 4 projects failed to build with the old tsc and were ignored tsconfig.json
discordjs/discord.js39 of 62 projects failed to build with the old tsc and were ignored packages/collection/tsconfig.json
packages/collection/tsconfig.eslint.json
packages/collection/tsconfig.docs.json
mui/material-ui29 of 81 projects failed to build with the old tsc and were ignored docs/tsconfig.json
sequelize/sequelize13 of 16 projects failed to build with the old tsc and were ignored packages/utils/tsconfig.json
|
Sorry, something went wrong.
|
|
||
| // use to determine if a parameter may be undefined or null (or is unknown/unconstrained) | ||
| function getUnknownIfMaybeUnknown(type: Type) { | ||
| return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type; |
There was a problem hiding this comment.
I'm assuming from #59059 that making this change to getTypeFacts breaks a lot of existing code, is that right?
Also, does making this change to checkNonNullType instead also break a lot of code?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, I tried that and putting this change directly into checkNonNullType gets a very similar result to #59059 in terms of breaking object index checking
Sorry, something went wrong.
There was a problem hiding this comment.
A lot of the cases that break relate to this type of index access #59059 (comment)
Sorry, something went wrong.
There was a problem hiding this comment.
I don't know if this it's noticeably different in semantics, but istead of doing this, you might want to try to modify getBaseTypeOfLiteralTypeForComparison and rename it getBaseTypeForComparison. Then pass the result of that into checkNonNullType.
Sorry, something went wrong.
There was a problem hiding this comment.
I would also consider renaming this to getBaseConstraintOrUnknown, use ?? instead of ||, and just get rid of the strictNullChecks check.
Sorry, something went wrong.
There was a problem hiding this comment.
Also - any clue if this works on unions of unconstrained type parameters? Can you add a test?
function f<T, U>(x: T | U, y: T | U) {
return x < y;
}
Sorry, something went wrong.
|
Checking this TypeScript Bot (@typescript-bot) perf test this |
Sorry, something went wrong.
|
Starting jobs; this comment will be updated as builds start and complete.
|
Sorry, something went wrong.
|
|
||
| // use to determine if a parameter may be undefined or null (or is unknown/unconstrained) | ||
| function getUnknownIfMaybeUnknown(type: Type) { | ||
| return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type; |
There was a problem hiding this comment.
I don't know if this it's noticeably different in semantics, but istead of doing this, you might want to try to modify getBaseTypeOfLiteralTypeForComparison and rename it getBaseTypeForComparison. Then pass the result of that into checkNonNullType.
Sorry, something went wrong.
|
|
||
| // use to determine if a parameter may be undefined or null (or is unknown/unconstrained) | ||
| function getUnknownIfMaybeUnknown(type: Type) { | ||
| return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type; |
There was a problem hiding this comment.
I would also consider renaming this to getBaseConstraintOrUnknown, use ?? instead of ||, and just get rid of the strictNullChecks check.
Sorry, something went wrong.
|
|
||
| // use to determine if a parameter may be undefined or null (or is unknown/unconstrained) | ||
| function getUnknownIfMaybeUnknown(type: Type) { | ||
| return (strictNullChecks && type.flags & TypeFlags.Instantiable) ? getBaseConstraintOfType(type) || unknownType : type; |
There was a problem hiding this comment.
Also - any clue if this works on unions of unconstrained type parameters? Can you add a test?
function f<T, U>(x: T | U, y: T | U) {
return x < y;
}
Sorry, something went wrong.
|
Daniel Rosenwasser (@DanielRosenwasser)
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
Daniel Rosenwasser (@DanielRosenwasser) Thanks for the suggestions! Good catch--it does work for unions but not intersections, so I added those cases as well. |
Sorry, something went wrong.
|
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.
|
Gabriela Araujo Britto (@gabritto) Here are the results of running the user tests with tsc comparing main and refs/pull/59352/merge: Everything looks good! |
Sorry, something went wrong.
|
Hey Gabriela Araujo Britto (@gabritto), the results of running the DT tests are ready. Everything looks the same! |
Sorry, something went wrong.
|
Gabriela Araujo Britto (@gabritto)
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
Gabriela Araujo Britto (@gabritto) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/59352/merge: Something interesting changed - please have a look. Detailsag-grid/ag-grid31 of 110 projects failed to build with the old tsc and were ignored enterprise-modules/viewport-row-model/tsconfig.watch.json
enterprise-modules/viewport-row-model/tsconfig.types.watch.json
enterprise-modules/status-bar/tsconfig.watch.json
enterprise-modules/status-bar/tsconfig.types.watch.json
enterprise-modules/sparklines/tsconfig.watch.json
enterprise-modules/sparklines/tsconfig.types.watch.json
enterprise-modules/side-bar/tsconfig.watch.json
enterprise-modules/side-bar/tsconfig.types.watch.json
enterprise-modules/set-filter/tsconfig.watch.json
enterprise-modules/set-filter/tsconfig.types.watch.json
enterprise-modules/server-side-row-model/tsconfig.watch.json
enterprise-modules/server-side-row-model/tsconfig.types.watch.json
enterprise-modules/row-grouping/tsconfig.watch.json
enterprise-modules/row-grouping/tsconfig.types.watch.json
enterprise-modules/rich-select/tsconfig.watch.json
enterprise-modules/rich-select/tsconfig.types.watch.json
enterprise-modules/range-selection/tsconfig.watch.json
enterprise-modules/range-selection/tsconfig.types.watch.json
enterprise-modules/multi-filter/tsconfig.watch.json
enterprise-modules/multi-filter/tsconfig.types.watch.json
enterprise-modules/master-detail/tsconfig.watch.json
enterprise-modules/master-detail/tsconfig.types.watch.json
enterprise-modules/filter-tool-panel/tsconfig.watch.json
enterprise-modules/filter-tool-panel/tsconfig.types.watch.json
enterprise-modules/core/tsconfig.watch.json
enterprise-modules/core/tsconfig.types.watch.json
enterprise-modules/advanced-filter/tsconfig.watch.json
enterprise-modules/advanced-filter/tsconfig.types.watch.json
community-modules/vue3/tsconfig.watch.json
community-modules/vue3/tsconfig.types.watch.json
community-modules/infinite-row-model/tsconfig.watch.json
community-modules/infinite-row-model/tsconfig.types.watch.json
community-modules/csv-export/tsconfig.watch.json
community-modules/csv-export/tsconfig.types.watch.json
community-modules/core/tsconfig.watch.json
community-modules/core/tsconfig.types.watch.json
community-modules/client-side-row-model/tsconfig.watch.json
community-modules/client-side-row-model/tsconfig.types.watch.json
compiler-explorer/compiler-explorer4 of 6 projects failed to build with the old tsc and were ignored static/tsconfig.json
desktop/desktop1 of 4 projects failed to build with the old tsc and were ignored tsconfig.json
sequelize/sequelize13 of 16 projects failed to build with the old tsc and were ignored packages/utils/tsconfig.json
|
Sorry, something went wrong.
|
I have just put up #59437 which I believe is the right fix for #50603 plus the inconsistencies related to unconstrained type parameters vs. type parameters constrained to {} | null | undefined. There are an awful lot of interacting parts here. In particular, it only becomes feasible to check that unconstrained generic types are possibly nullable in --strictNullChecks mode by first fixing the fact that obj shouldn't be null-checked in obj[key] when obj and key both have generic types. |
Sorry, something went wrong.
|
With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies). Next steps for PRs:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
fixes #50603, which bisected to #49119
Previously: unconstrained type parameters were inconsistently checked in comparisons, as shown below (5.5.3 playground):
Now with this PR:
This PR does not affect the checking of unconstrained types in other locations.