diff --git a/tests/baselines/reference/checkJsdocTypeTag3.errors.txt b/tests/baselines/reference/checkJsdocTypeTag3.errors.txt deleted file mode 100644 index d53c0972fa3..00000000000 --- a/tests/baselines/reference/checkJsdocTypeTag3.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/conformance/jsdoc/0.js(5,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'. -tests/cases/conformance/jsdoc/0.js(12,1): error TS2322: Type 'number' is not assignable to type 'string'. - - -==== tests/cases/conformance/jsdoc/0.js (2 errors) ==== - // @ts-check - - /** @type {function (number)} */ - const x1 = (a) => a + 1; - x1("string"); - ~~~~~~~~ -!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'number'. - - /** @type {function (number): number} */ - const x2 = (a) => a + 1; - - /** @type {string} */ - var a; - a = x2(0); - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag3.js b/tests/baselines/reference/checkJsdocTypeTag3.js deleted file mode 100644 index 2eb50223ba2..00000000000 --- a/tests/baselines/reference/checkJsdocTypeTag3.js +++ /dev/null @@ -1,24 +0,0 @@ -//// [0.js] -// @ts-check - -/** @type {function (number)} */ -const x1 = (a) => a + 1; -x1("string"); - -/** @type {function (number): number} */ -const x2 = (a) => a + 1; - -/** @type {string} */ -var a; -a = x2(0); - -//// [0.js] -// @ts-check -/** @type {function (number)} */ -var x1 = function (a) { return a + 1; }; -x1("string"); -/** @type {function (number): number} */ -var x2 = function (a) { return a + 1; }; -/** @type {string} */ -var a; -a = x2(0); diff --git a/tests/baselines/reference/checkJsdocTypeTag3.symbols b/tests/baselines/reference/checkJsdocTypeTag3.symbols new file mode 100644 index 00000000000..4e731fbdc87 --- /dev/null +++ b/tests/baselines/reference/checkJsdocTypeTag3.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/jsdoc/test.js === +/** @type {Array} */ +var nns; +>nns : Symbol(nns, Decl(test.js, 1, 3)) + diff --git a/tests/baselines/reference/checkJsdocTypeTag3.types b/tests/baselines/reference/checkJsdocTypeTag3.types new file mode 100644 index 00000000000..94d953e0b44 --- /dev/null +++ b/tests/baselines/reference/checkJsdocTypeTag3.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/jsdoc/test.js === +/** @type {Array} */ +var nns; +>nns : number[] + diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 4f566c1a7ae..b813c08705b 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -84,7 +84,6 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(169,20): e tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(169,23): error TS1003: Identifier expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(169,27): error TS1005: ',' expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(170,23): error TS1005: ',' expected. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(170,24): error TS1138: Parameter declaration expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(171,28): error TS1003: Identifier expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(171,32): error TS1005: ',' expected. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(172,30): error TS1005: ',' expected. @@ -94,7 +93,7 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,32): e tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): error TS2304: Cannot find name 'm'. -==== tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts (60 errors) ==== +==== tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts (59 errors) ==== class C { n: number; explicitThis(this: this, m: number): number { @@ -403,8 +402,6 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e function optional(this?: C): number { return this.n; } ~ !!! error TS1005: ',' expected. - ~ -!!! error TS1138: Parameter declaration expected. function decorated(@deco() this: C): number { return this.n; } ~~~~ !!! error TS1003: Identifier expected. diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.js b/tests/baselines/reference/thisTypeInFunctionsNegative.js index c0a6ecb1dee..94a0565e237 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.js +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.js @@ -345,7 +345,7 @@ function modifiers(, C) { return this.n; } function restParam(C) { return this.n; } -function optional(C) { return this.n; } +function optional() { return this.n; } function decorated(, C) { if ( === void 0) { = this; } return this.n; diff --git a/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts b/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts new file mode 100644 index 00000000000..0051e1029f9 --- /dev/null +++ b/tests/cases/conformance/jsdoc/checkJsdocTypeTag3.ts @@ -0,0 +1,6 @@ +// @Filename:test.js +// @checkJs: true +// @allowJs: true +// @noEmit: true +/** @type {Array} */ +var nns;