-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
andrewbranch/typescript-go
#19Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
- This is a crash
- This changed between versions ______ and _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
⏯ Playground Link
Playground link with relevant code
💻 Code
Version 4.4.0-dev.20210705
export function f1()
{
return Promise.resolve(1).catch(e => null)
}
export function f2()
{
return Promise.resolve(1).catch(e => null as null)
}
// @ts-expect-error
f1().then(v => v.split('')) // <====== should is `number` but `any`
// @ts-expect-error
f2().then(v => v.split(''))
{
"compilerOptions": {
"module": "commonjs",
"target": "es2019",
"jsx": "preserve",
"moduleResolution": "node",
"allowJs": false,
"allowUmdGlobalAccess": false,
"sourceMap": true,
"inlineSourceMap": false,
"inlineSources": true,
"declaration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"strict": false,
"strictBindCallApply": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noImplicitOverride": true,
"preserveConstEnums": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"noErrorTruncation": true,
"removeComments": true,
"traceResolution": false,
"newLine": "lf",
"esModuleInterop": true,
"importHelpers": true
}
}
🙁 Actual behavior
// @ts-expect-error
f1().then(v => v.split('')) // <====== should is `number` but `any`
🙂 Expected behavior
// @ts-expect-error
f1().then(v => v.split('')) // <====== should is `number`
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone