You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A regression is introduced by upgrading TypeScript to v5.0. This is caused by a breaking change in TypeScript's type narrowing behavior.
Example:
typeType=number|Date| ...
letvalue: Typeif(typeofvalue==='number'||valueinstanceofDate){// Type of 'value' is not `number | Date`, but `(Type & number) | (Type & Date)`.}
Error:
TypeScriptError: Failedtoinitialisetheproject.src/structs/refinements.ts:165:10-error TS2365: Operator '<=' cannot be applied to types 'number' and '(Type&number)|(Type&Date)'.165 (minimum <= value && value <= maximum) || ~~~~~~~~~~~~~~~~src/structs/refinements.ts:165:30 - error TS2365: Operator '<=' cannot be applied to types '(Type&number)|(Type&Date)' and 'number'.
165 (minimum <= value && value <= maximum) ||
~~~~~~~~~~~~~~~~
at getProgram (file:///Volumes/Code/metamask/superstruct/node_modules/@ts-bridge/cli/dist/build.js:36:15)
at buildHandler (file:///Volumes/Code/metamask/superstruct/node_modules/@ts-bridge/cli/dist/build.js:69:21)
at Object.handler (file:///Volumes/Code/metamask/superstruct/node_modules/@ts-bridge/cli/dist/cli.js:53:16)
at /Volumes/Code/metamask/superstruct/node_modules/yargs/build/index.cjs:1:8993
at j (/Volumes/Code/metamask/superstruct/node_modules/yargs/build/index.cjs:1:4956)
at _.handleValidationAndGetResult (/Volumes/Code/metamask/superstruct/node_modules/yargs/build/index.cjs:1:8962)
at _.applyMiddlewareAndGetResult (/Volumes/Code/metamask/superstruct/node_modules/yargs/build/index.cjs:1:9604)
at _.runCommand (/Volumes/Code/metamask/superstruct/node_modules/yargs/build/index.cjs:1:7231)
at [runYargsParserAndExecuteCommands] (/Volumes/Code/metamask/superstruct/node_modules/yargs/build/index.cjs:1:58912)
at te.parse (/Volumes/Code/metamask/superstruct/node_modules/yargs/build/index.cjs:1:40478)
The text was updated successfully, but these errors were encountered:
A regression is introduced by upgrading TypeScript to v5.0. This is caused by a breaking change in TypeScript's type narrowing behavior.
The text was updated successfully, but these errors were encountered: