Skip to content

This type in jsdoc cause ts2502 but cannot reproduce with ts #63468

@qwq0

Description

@qwq0

🔎 Search Terms

jsdoc ts2502 ts(2502)

🕗 Version & Regression Information

  • This changed between versions : no
  • This changed in commit or PR : no
  • This is the behavior in every version I tried: the version builtin vscode and i tried the nightly version

⏯ Playground Link

No response

💻 Code

import Sequelize, { Model } from "@sequelize/core";

/**
 * init models
 */
export function initModels(sequelize: Sequelize, models: (typeof Model)[])
{
    models.forEach((o) =>
    {
    });

    // for(let o of models)
    // {}
}
/**
 * init models
 * @param {Sequelize} sequelize 
 * @param {(typeof Model)[]} models
 */
export function initModels(sequelize, models)
{
    models.forEach((o) =>
    {
    });

    // for(let o of models)
    // {}
}

🙁 Actual behavior

get ts2502 in jsdoc, but pass in ts

Image Image

🙂 Expected behavior

all get pass

Additional information about the issue

I found that it can pass normally without using forEach or any other Array methods

Image

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