Skip to content

Wrong warning about Duplicate identifier defined by js-doc #62956

@saeed-serpooshan

Description

@saeed-serpooshan

Type: Bug

Create a simple .js file that contain just a js-doc type def followed directly by an IIFE code block shows a wrong warning of:
"Duplicate identifier 'TestType'. ts(2300)"

Here is the sample Code:

/**
 * @typedef {Object} TestType
 * @property {number} code
 * @property {string} name
*/

(() => { //a simple IIFE code block cause above typedef shows a problem warning!
    var t = 100;
})();

The screenshot is attached below:
Image

VS Code version: Code 1.107.1 (994fd12f8d3a5aa16f17d42c041e5809167e845a, 2025-12-17T14:15:14.850Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
Process Argv --disable-extensions --crash-reporter-id d6bf8066-e77c-457a-ad85-b655481ed72d
Screen Reader no
VM 0%
Extensions disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions