Skip to content

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

Closed

Description

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.

Activity

  1. added
    Rescheduled
    and removed
    Rescheduled
    on Aug 31, 2020
  2. added
    Fix Available
    on Sep 8, 2020
  3. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugFix Available

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ Proxy