Uh oh!
There was an error while loading. Please reload this page.
Widen boolean literals when contextual type is full boolean type - #48368
Widen boolean literals when contextual type is full boolean type#48368Anders Hejlsberg (ahejlsberg) wants to merge 5 commits into
Conversation
Anders Hejlsberg (ahejlsberg)
commented
Mar 21, 2022
TypeScript Bot (@typescript-bot) test this |
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the extended test suite on this PR at b54de54. You can monitor the build here. |
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! |
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. |
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! |
TypeScript Bot (typescript-bot)
commented
Mar 21, 2022
Anders Hejlsberg (@ahejlsberg) Here they are:Comparison Report - main..48368
System
Hosts
Scenarios
Developer Information: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TypeScript Bot (typescript-bot)
commented
Mar 21, 2022
Anders Hejlsberg (@ahejlsberg) |
Anders Hejlsberg (ahejlsberg)
commented
Mar 22, 2022
Apart from lots of letx: {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 The other change is in declarefunctionfoldLeft<U>(z: U,f: (acc: U,t: boolean)=>U): U;letres: boolean=foldLeft(true,(acc,t)=>acc&&t);// Was error, now okPreviously the |
Anders Hejlsberg (ahejlsberg)
commented
Mar 22, 2022
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. |
Bruce Pascoe (fatcerberus)
commented
Mar 22, 2022
Someone brought this up in Discord: letfoo: boolean=false;With the change in this PR, does this no longer narrow-on-assignment to |
Several Definitely Typed packages are adversely affected. Closing this PR and putting up #48380 with less impact. |
Fixes#48363.
Also fixes issue mentioned here because boolean literals contextually typed by
booleanare now widened.