| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
TypeScript Bot (@typescript-bot) test this |
Sorry, something went wrong.
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the extended test suite on this PR at b54de54. You can monitor the build here. |
Sorry, something went wrong.
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the abridged perf test suite on this PR at b54de54. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the parallelized Definitely Typed test suite on this PR at b54de54. You can monitor the build here. |
Sorry, something went wrong.
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the diff-based community code test suite on this PR at b54de54. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
|
Anders Hejlsberg (@ahejlsberg) Comparison Report - main..48368
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sorry, something went wrong.
|
Anders Hejlsberg (@ahejlsberg) |
Sorry, something went wrong.
|
Apart from lots of false and true types changing to boolean (as expected), there are really only two notable changes in the baselines. One is in excessPropertyCheckWithMultipleDiscriminants.ts, simplified to: let x: { kind: false, x: number } | { kind: boolean, x: string } = { kind: false, x: 42 };Previously this would match against the first variant and succeed. It now matches against the second variant (because the kind: false in the object literal is given type boolean as it is contextually typed by boolean). It's possible to get the old behavior by writing kind: false as const. I think this change is acceptable. The other change is in inferFromGenericFunctionReturnTypes3.ts: declare function foldLeft<U>(z: U, f: (acc: U, t: boolean) => U): U;
let res: boolean = foldLeft(true, (acc, t) => acc && t); // Was error, now okPreviously the true literal wasn't widened and therefore acc and t would have type true, which doesn't work out. We now widen and the example works as expected. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the parallelized Definitely Typed test suite on this PR at af5bd9e. You can monitor the build here. |
Sorry, something went wrong.
|
Someone brought this up in Discord: let foo: boolean = false;With the change in this PR, does this no longer narrow-on-assignment to false? |
Sorry, something went wrong.
|
Several Definitely Typed packages are adversely affected. Closing this PR and putting up #48380 with less impact. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #48363.
Also fixes issue mentioned here because boolean literals contextually typed by boolean are now widened.