Skip to content

Jsdoc unable to refer template from another template's constaint聽#43403

Description

Bug Report

馃攷 Search Terms jsdoc template

馃晽 Version 4.3.0-dev.20210327

馃捇 Code

In .ts files we are able to refer template type from another template's constraint

type A<T1, T2 extends T1> = [T1, T2]

But in jsdoc it's not possible

/** 
 * @template T1
 * // Cannot find name 'T1'.ts(2304)
 * @template {T1} T2
 * 
 * @typedef {[T1, T2]} A
 */

馃檨 Actual behavior

'Cannot find name' error

馃檪 Expected behavior

No error

Activity

  1. changed the title [-]Jsdoc unable to refer template from another template constaint[/-] [+]Jsdoc unable to refer template from another template's constaint[/+] on Mar 27, 2021
  2. ilogico commented on Mar 28, 2021

    @ilogico

    This is very strange. It happens with typedef only, but I have different errors depending on the location of the typedef.
    This one says B doesn't satisfy A.
    This one works.
    And this one reproduces your error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions