Closed
Description
Bug Report
π Search Terms
if unkown null
π Version & Regression Information
typescript@next
This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
β― Playground Link
Playground link with relevant code
π» Code
declare const error: unknown
if (error) {
throw typeof error === 'object' && 'message' in error ? Object.assign(new Error(), error) : error
}
π Actual behavior
Object is possibly 'null'.
π Expected behavior
No error, if (error)
has already ensured error
will never be null
.
Metadata
Metadata
Assignees
Labels
No labels