Skip to content

JSDoc @template should introduce a type in JS #16411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jun 9, 2017 · 2 comments
Closed

JSDoc @template should introduce a type in JS #16411

ghost opened this issue Jun 9, 2017 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation

Comments

@ghost
Copy link

ghost commented Jun 9, 2017

TypeScript Version: nightly (2.4.0-dev.20170609)

Code

a.js

/** @template T */
class C {
    /** @param {T} x */
    constructor(x) {
        /** @type {T} */
        this.x = x;
    }
}

Expected behavior:

No error.

Actual behavior:

app/main.js(3,17): error TS2304: Cannot find name 'T'.
app/main.js(4,17): error TS7006: Parameter 'x' implicitly has an 'any' type.
app/main.js(5,20): error TS2304: Cannot find name 'T'.
@mhegazy mhegazy added the Bug A bug in TypeScript label Jun 9, 2017
@mhegazy mhegazy added this to the TypeScript 2.5 milestone Jun 9, 2017
@mhegazy mhegazy added Domain: JSDoc Relates to JSDoc parsing and type generation Salsa labels Jun 9, 2017
@dyst5422
Copy link

#16485 is related

@mhegazy
Copy link
Contributor

mhegazy commented Sep 1, 2017

duplicate of #18135

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation
Projects
None yet
Development

No branches or pull requests

3 participants