Tighten relational operator more#52342
Conversation
|
@typescript-bot test this |
|
Heya @RyanCavanaugh, I've started to run the diff-based user code test suite (tsserver) on this PR at 5f7d2d9. You can monitor the build here. Update: The results are in! |
|
Heya @RyanCavanaugh, I've started to run the parallelized Definitely Typed test suite on this PR at 5f7d2d9. You can monitor the build here. |
|
Heya @RyanCavanaugh, I've started to run the diff-based user code test suite on this PR at 5f7d2d9. You can monitor the build here. Update: The results are in! |
|
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at 5f7d2d9. You can monitor the build here. |
|
Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite (tsserver) on this PR at 5f7d2d9. You can monitor the build here. Update: The results are in! |
|
Heya @RyanCavanaugh, I've started to run the diff-based top-repos suite on this PR at 5f7d2d9. You can monitor the build here. Update: The results are in! |
|
Heya @RyanCavanaugh, I've started to run the perf test suite on this PR at 5f7d2d9. You can monitor the build here. Update: The results are in! |
|
@RyanCavanaugh Here are the results of running the user test suite comparing Everything looks good! |
|
@RyanCavanaugh Here are the results of running the user test suite comparing Something interesting changed - please have a look. Details
|
|
Heya @RyanCavanaugh, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
|
OK, let's analyze.
export const Ord: O.Ord<boolean> = {
equals: Eq.equals,
compare: (first, second) => (first < second ? -1 : first > second ? 1 : 0)
}This seems more straightforwardly written as Webpack's is... subtle: /**
* @param {string|number} a first id
* @param {string|number} b second id
* @returns {-1|0|1} compare result
*/
const compareIds = (a, b) => {
if (typeof a !== typeof b) {
return typeof a < typeof b ? -1 : 1;
}
if (a < b) return -1;
if (a > b) return 1;
return 0;
};The reasonable objection at the erroring line ( The other break in webpack, here seems like it might also be correct-by-construction but the code is quite complex and I'm not really sure what's going on here. RWC turned up several instances of relating |
|
This allows TLD;R we can't really blame this on implicit coercion, since the implicit coercion that occurs in |
|
@RyanCavanaugh Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Detailspalantir/blueprint
|
|
@RyanCavanaugh Here they are:
CompilerComparison Report - main..52342
System
Hosts
Scenarios
TSServerComparison Report - main..52342
System
Hosts
Scenarios
StartupComparison Report - main..52342
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@RyanCavanaugh Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Details
|
Addendum to #52048 per discussion there. Evaluating the real-world code impact before discussing further