-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strict variance checks for strict subtype checks unconditionally #48123
base: main
Are you sure you want to change the base?
Conversation
Is this comment in #41977 relevant at all?
|
For the subtype relation, that's probably true, however for the |
(You can see the playground link in the OP for an example of the very problematic order dependence issue) |
@typescript-bot pack this |
Heya @weswigham, I've started to run the extended test suite on this PR at 949daee. You can monitor the build here. |
Heya @weswigham, I've started to run the tarball bundle task on this PR at 949daee. You can monitor the build here. |
Heya @weswigham, I've started to run the perf test suite on this PR at 949daee. You can monitor the build here. Update: The results are in! |
Heya @weswigham, I've started to run the diff-based community code test suite on this PR at 949daee. You can monitor the build here. Update: The results are in! |
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 949daee. You can monitor the build here. |
@weswigham Here they are:Comparison Report - main..refs/pull/48123/merge [bcryptjs]1 of 1 projects failed to build with the old tsc /mnt/ts_downloads/bcryptjs/tsconfig.json
|
@@ -36,8 +36,8 @@ var cs = [a, b, c]; // { x: number; y?: number };[] | |||
>c : { x: number; a?: number; } | |||
|
|||
var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] | |||
>ds : ((x: Object) => number)[] | |||
>[(x: Object) => 1, (x: string) => 2] : ((x: Object) => number)[] | |||
>ds : ((x: string) => number)[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big correctness improvement, so we should document it as a breaking change
@weswigham Here they are:Comparison Report - main..48123
System
Hosts
Scenarios
Developer Information: |
Man, xstate is fine but compiler-unions really hates this; but... Why? None of the unions in compiler-unions even have methods... Hm. Probably warrants investigation. |
@typescript-bot perf test this |
Heya @weswigham, I've started to run the perf test suite on this PR at afb0126. You can monitor the build here. Update: The results are in! |
@weswigham Here they are:Comparison Report - main..48123
System
Hosts
Scenarios
Developer Information: |
@weswigham did this pan out? Did you figure out why compiler-unions slowed down? It's old enough that I'd like to close it if it didn't. |
I was reviewing some older PRs in my review queue and realized I had some extra insight into one in particular since I'd last commented on it.
This is an improvement to #41995 that, rather than making anything dependent on the
strictFunctionTypes
flag, instead changes the strict subtype relation to always use strict function argument variance, which both fixes #41977, and should prevent order-dependence issues like those described in #46814 (but with methods instead of readonly props, like so) as well.