Skip to content

Uncaught exception in "catch" type annotation with destructuring #40222

@Ky6uk

Description

@Ky6uk

TypeScript Version:

  • 4.0.2
  • 4.1.0-dev.20200824

TypeScript versions below 4.0 are not affected.

Search Terms: try/catch, destructuring, type annotation

Code

async function bork() {
  try {
    await woof();
  } catch ({ message } : any) {
    //                 ^-- language server goes down after typing this symbol ":"
    return message;
  }
}

Expected behavior:

No uncaught errors.

Actual behavior:

The language server is down because of an uncaught exception.

TypeError: Cannot read property 'flags' of undefined

Playground Link:

Is here.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions