Skip to content

Missing property types on the function object #39886

@samuelhulla

Description

@samuelhulla

Information:

  • VSCode Version: 1.47.3
  • OS Version: Darwin x64 19.4.0

Steps to Reproduce:

  1. Create a typescript project with enabled live typescript check in vscode.
  2. Attempt to access typescript function properties
const example = (
   callback: (...args: unknown[]) => unknown
): void => {
 try {
    callback()
 } catch (e) {
    const raisedError = {
       name: callback.name // <- issue here
       // ....
    }
  }
}

The following line produces the following error:

name: callback.name // Property 'name' does not exist on type '(...args: unknown[]) => unknown'

Despite the fact these properties are accessible in the Function object.

Other information:

  • Typescript in my project (package.json) is "ˆ3.9.7" (which is the latest version as of the day of this issue being posted)
  • In my defaultSettings.json the typescript.tsdk is set to null (so it should use the latest version from package.json if I'm not mistaken)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions