Uh oh!
There was an error while loading. Please reload this page.
Fix #33448 - Filter discriminants of type never - #33498
Fix #33448 - Filter discriminants of type never#33498Jack Williams (jack-williams) wants to merge 1 commit into
Conversation
cdff27e to
97c5587CompareHere is something that is new with the PR (be it good or bad). exporttypeRuntimeValue={type: 'number',value: number,}|{type: 'string',value: string,}|{type: boolean,value: boolean,};functionfoo(x: RuntimeValue&({type: 'number'}|{type: 'string'})){if(x.type==="number"){x.value// now number}else{x.value// now string}}Awkwardly, this does not work. functionfoo(x: RuntimeValue&{type: 'number'}){if(x.type==="number"){x.value// number | string | boolean}else{x.value// number | string | boolean}}Is it worth expanding the definition of discriminant properties to fix this? |
Jack Williams (jack-williams)
commented
Sep 20, 2019
TypeScript Bot (@typescript-bot) test this |
Heya Jack Williams (@jack-williams), I've started to run the extended test suite on this PR at 97c5587. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya Jack Williams (@jack-williams), I've started to run the parallelized community code test suite on this PR at 97c5587. You can monitor the build here. It should now contribute to this PR's status checks. |
TypeScript Bot (typescript-bot)
commented
Sep 20, 2019
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
Fixes#33448