Test:ts-ignore works on jsdoc syntax errors

This commit is contained in:
Nathan Shively-Sanders
2017-11-17 10:40:16 -08:00
parent eeeefcc10e
commit c01f0c0b9f
4 changed files with 32 additions and 18 deletions

View File

@@ -12,8 +12,10 @@ tests/cases/conformance/jsdoc/badTypeArguments.js(2,22): error TS1009: Trailing
/** @param {C.<number,>} y */
~
!!! error TS1009: Trailing comma not allowed.
function f(x, y) {
// @ts-ignore
/** @param {C.<number,>} skipped */
function f(x, y, skipped) {
return x.t + y.t;
}
var x = f({ t: 1000 }, { t: 3000 });
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });

View File

@@ -8,22 +8,26 @@ declare class C<T> { t: T }
=== tests/cases/conformance/jsdoc/badTypeArguments.js ===
/** @param {C.<>} x */
/** @param {C.<number,>} y */
function f(x, y) {
// @ts-ignore
/** @param {C.<number,>} skipped */
function f(x, y, skipped) {
>f : Symbol(f, Decl(badTypeArguments.js, 0, 0))
>x : Symbol(x, Decl(badTypeArguments.js, 2, 11))
>y : Symbol(y, Decl(badTypeArguments.js, 2, 13))
>x : Symbol(x, Decl(badTypeArguments.js, 4, 11))
>y : Symbol(y, Decl(badTypeArguments.js, 4, 13))
>skipped : Symbol(skipped, Decl(badTypeArguments.js, 4, 16))
return x.t + y.t;
>x.t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
>x : Symbol(x, Decl(badTypeArguments.js, 2, 11))
>x : Symbol(x, Decl(badTypeArguments.js, 4, 11))
>t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
>y.t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
>y : Symbol(y, Decl(badTypeArguments.js, 2, 13))
>y : Symbol(y, Decl(badTypeArguments.js, 4, 13))
>t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
}
var x = f({ t: 1000 }, { t: 3000 });
>x : Symbol(x, Decl(badTypeArguments.js, 5, 3))
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });
>x : Symbol(x, Decl(badTypeArguments.js, 7, 3))
>f : Symbol(f, Decl(badTypeArguments.js, 0, 0))
>t : Symbol(t, Decl(badTypeArguments.js, 5, 11))
>t : Symbol(t, Decl(badTypeArguments.js, 5, 24))
>t : Symbol(t, Decl(badTypeArguments.js, 7, 11))
>t : Symbol(t, Decl(badTypeArguments.js, 7, 24))
>t : Symbol(t, Decl(badTypeArguments.js, 7, 37))

View File

@@ -8,10 +8,13 @@ declare class C<T> { t: T }
=== tests/cases/conformance/jsdoc/badTypeArguments.js ===
/** @param {C.<>} x */
/** @param {C.<number,>} y */
function f(x, y) {
>f : (x: C<any>, y: C<number>) => any
// @ts-ignore
/** @param {C.<number,>} skipped */
function f(x, y, skipped) {
>f : (x: C<any>, y: C<number>, skipped: C<number>) => any
>x : C<any>
>y : C<number>
>skipped : C<number>
return x.t + y.t;
>x.t + y.t : any
@@ -22,14 +25,17 @@ function f(x, y) {
>y : C<number>
>t : number
}
var x = f({ t: 1000 }, { t: 3000 });
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });
>x : any
>f({ t: 1000 }, { t: 3000 }) : any
>f : (x: C<any>, y: C<number>) => any
>f({ t: 1000 }, { t: 3000 }, { t: 5000 }) : any
>f : (x: C<any>, y: C<number>, skipped: C<number>) => any
>{ t: 1000 } : { t: number; }
>t : number
>1000 : 1000
>{ t: 3000 } : { t: number; }
>t : number
>3000 : 3000
>{ t: 5000 } : { t: number; }
>t : number
>5000 : 5000

View File

@@ -8,7 +8,9 @@ declare class C<T> { t: T }
// @Filename: badTypeArguments.js
/** @param {C.<>} x */
/** @param {C.<number,>} y */
function f(x, y) {
// @ts-ignore
/** @param {C.<number,>} skipped */
function f(x, y, skipped) {
return x.t + y.t;
}
var x = f({ t: 1000 }, { t: 3000 });
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });