mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 12:55:49 -05:00
Update baselines
This commit is contained in:
@@ -44,8 +44,8 @@ namespace ts {
|
||||
parsesCorrectly("functionType1", "{function()}");
|
||||
parsesCorrectly("functionType2", "{function(string, boolean)}");
|
||||
parsesCorrectly("functionReturnType1", "{function(string, boolean)}");
|
||||
parsesCorrectly("thisType1", "{this:a.b}");
|
||||
parsesCorrectly("newType1", "{new:a.b}");
|
||||
parsesCorrectly("thisType1", "{function(this:a.b)}");
|
||||
parsesCorrectly("newType1", "{function(new:a.b)}");
|
||||
parsesCorrectly("variadicType", "{...number}");
|
||||
parsesCorrectly("optionalType", "{number=}");
|
||||
parsesCorrectly("optionalNullable", "{?=}");
|
||||
@@ -64,7 +64,7 @@ namespace ts {
|
||||
parsesCorrectly("tupleType3", "{[number,string,boolean]}");
|
||||
parsesCorrectly("tupleTypeWithTrailingComma", "{[number,]}");
|
||||
parsesCorrectly("typeOfType", "{typeof M}");
|
||||
parsesCorrectly("tsConstructoType", "{new () => string}");
|
||||
parsesCorrectly("tsConstructorType", "{new () => string}");
|
||||
parsesCorrectly("tsFunctionType", "{() => string}");
|
||||
parsesCorrectly("typeArgumentsNotFollowingDot", "{a<>}");
|
||||
parsesCorrectly("functionTypeWithTrailingComma", "{function(a,)}");
|
||||
|
||||
@@ -1,32 +1,51 @@
|
||||
{
|
||||
"kind": "JSDocConstructorType",
|
||||
"pos": 4,
|
||||
"end": 8,
|
||||
"kind": "JSDocFunctionType",
|
||||
"pos": 1,
|
||||
"end": 18,
|
||||
"flags": "JSDoc",
|
||||
"type": {
|
||||
"kind": "TypeReference",
|
||||
"pos": 5,
|
||||
"end": 8,
|
||||
"flags": "JSDoc",
|
||||
"typeName": {
|
||||
"kind": "FirstNode",
|
||||
"pos": 5,
|
||||
"end": 8,
|
||||
"parameters": {
|
||||
"0": {
|
||||
"kind": "Parameter",
|
||||
"pos": 10,
|
||||
"end": 17,
|
||||
"flags": "JSDoc",
|
||||
"left": {
|
||||
"name": {
|
||||
"kind": "Identifier",
|
||||
"pos": 5,
|
||||
"end": 6,
|
||||
"pos": 10,
|
||||
"end": 13,
|
||||
"flags": "JSDoc",
|
||||
"text": "a"
|
||||
"originalKeywordKind": "NewKeyword",
|
||||
"text": "new"
|
||||
},
|
||||
"right": {
|
||||
"kind": "Identifier",
|
||||
"pos": 7,
|
||||
"end": 8,
|
||||
"type": {
|
||||
"kind": "TypeReference",
|
||||
"pos": 14,
|
||||
"end": 17,
|
||||
"flags": "JSDoc",
|
||||
"text": "b"
|
||||
"typeName": {
|
||||
"kind": "FirstNode",
|
||||
"pos": 14,
|
||||
"end": 17,
|
||||
"flags": "JSDoc",
|
||||
"left": {
|
||||
"kind": "Identifier",
|
||||
"pos": 14,
|
||||
"end": 15,
|
||||
"flags": "JSDoc",
|
||||
"text": "a"
|
||||
},
|
||||
"right": {
|
||||
"kind": "Identifier",
|
||||
"pos": 16,
|
||||
"end": 17,
|
||||
"flags": "JSDoc",
|
||||
"text": "b"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"length": 1,
|
||||
"pos": 10,
|
||||
"end": 17
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,51 @@
|
||||
{
|
||||
"kind": "JSDocThisType",
|
||||
"pos": 5,
|
||||
"end": 9,
|
||||
"kind": "JSDocFunctionType",
|
||||
"pos": 1,
|
||||
"end": 19,
|
||||
"flags": "JSDoc",
|
||||
"type": {
|
||||
"kind": "TypeReference",
|
||||
"pos": 6,
|
||||
"end": 9,
|
||||
"flags": "JSDoc",
|
||||
"typeName": {
|
||||
"kind": "FirstNode",
|
||||
"pos": 6,
|
||||
"end": 9,
|
||||
"parameters": {
|
||||
"0": {
|
||||
"kind": "Parameter",
|
||||
"pos": 10,
|
||||
"end": 18,
|
||||
"flags": "JSDoc",
|
||||
"left": {
|
||||
"name": {
|
||||
"kind": "Identifier",
|
||||
"pos": 6,
|
||||
"end": 7,
|
||||
"pos": 10,
|
||||
"end": 14,
|
||||
"flags": "JSDoc",
|
||||
"text": "a"
|
||||
"originalKeywordKind": "ThisKeyword",
|
||||
"text": "this"
|
||||
},
|
||||
"right": {
|
||||
"kind": "Identifier",
|
||||
"pos": 8,
|
||||
"end": 9,
|
||||
"type": {
|
||||
"kind": "TypeReference",
|
||||
"pos": 15,
|
||||
"end": 18,
|
||||
"flags": "JSDoc",
|
||||
"text": "b"
|
||||
"typeName": {
|
||||
"kind": "FirstNode",
|
||||
"pos": 15,
|
||||
"end": 18,
|
||||
"flags": "JSDoc",
|
||||
"left": {
|
||||
"kind": "Identifier",
|
||||
"pos": 15,
|
||||
"end": 16,
|
||||
"flags": "JSDoc",
|
||||
"text": "a"
|
||||
},
|
||||
"right": {
|
||||
"kind": "Identifier",
|
||||
"pos": 17,
|
||||
"end": 18,
|
||||
"flags": "JSDoc",
|
||||
"text": "b"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"length": 1,
|
||||
"pos": 10,
|
||||
"end": 18
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(2,10): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(4,15): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(4,27): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(7,20): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(10,18): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(11,12): error TS2554: Expected 1 arguments, but got 2.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(13,14): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(14,11): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(15,8): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(16,15): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(17,11): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(18,17): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(19,5): error TS2322: Type 'undefined' is not assignable to type 'number | null'.
|
||||
tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts(19,17): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsdoc/jsdocDisallowedInTypescript.ts (14 errors) ====
|
||||
// grammar error from checker
|
||||
var ara: Array.<number> = [1,2,3];
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
|
||||
function f(x: ?number, y: Array.<number>) {
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
return x ? x + y[1] : y[0];
|
||||
}
|
||||
function hof(ctor: function(new: number, string)) {
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
return new ctor('hi');
|
||||
}
|
||||
function hof2(f: function(this: number, string): string) {
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
return f(12, 'hullo');
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2554: Expected 1 arguments, but got 2.
|
||||
}
|
||||
var whatevs: * = 1001;
|
||||
~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var ques: ? = 'what';
|
||||
~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var g: function(number, number): number = (n,m) => n + m;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var variadic: ...boolean = [true, false, true];
|
||||
~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var most: !string = 'definite';
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var postfixdef: number! = 101;
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var postfixopt: number? = undefined;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'number | null'.
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//// [jsdocInTypescript.ts]
|
||||
//// [jsdocDisallowedInTypescript.ts]
|
||||
// grammar error from checker
|
||||
var ara: Array.<number> = [1,2,3];
|
||||
|
||||
@@ -16,13 +16,11 @@ var ques: ? = 'what';
|
||||
var g: function(number, number): number = (n,m) => n + m;
|
||||
var variadic: ...boolean = [true, false, true];
|
||||
var most: !string = 'definite';
|
||||
var weird1: new:string = {};
|
||||
var weird2: this:string = {};
|
||||
var postfixdef: number! = 101;
|
||||
var postfixopt: number? = undefined;
|
||||
|
||||
|
||||
//// [jsdocInTypescript.js]
|
||||
//// [jsdocDisallowedInTypescript.js]
|
||||
"use strict";
|
||||
// grammar error from checker
|
||||
var ara = [1, 2, 3];
|
||||
@@ -40,7 +38,5 @@ var ques = 'what';
|
||||
var g = function (n, m) { return n + m; };
|
||||
var variadic = [true, false, true];
|
||||
var most = 'definite';
|
||||
var weird1 = {};
|
||||
var weird2 = {};
|
||||
var postfixdef = 101;
|
||||
var postfixopt = undefined;
|
||||
@@ -1,85 +0,0 @@
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(2,10): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(4,15): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(4,27): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(7,20): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(7,32): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(10,18): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(10,31): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(11,12): error TS2554: Expected 1 arguments, but got 2.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(13,14): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(14,11): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(15,8): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(16,15): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(17,11): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(18,5): error TS2322: Type '{}' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(18,16): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(19,5): error TS2322: Type '{}' is not assignable to type 'string'.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(19,17): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(20,17): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(21,5): error TS2322: Type 'undefined' is not assignable to type 'number | null'.
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript.ts(21,17): error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsdoc/jsdocInTypescript.ts (20 errors) ====
|
||||
// grammar error from checker
|
||||
var ara: Array.<number> = [1,2,3];
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
|
||||
function f(x: ?number, y: Array.<number>) {
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
return x ? x + y[1] : y[0];
|
||||
}
|
||||
function hof(ctor: function(new: number, string)) {
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
return new ctor('hi');
|
||||
}
|
||||
function hof2(f: function(this: number, string): string) {
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
return f(12, 'hullo');
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2554: Expected 1 arguments, but got 2.
|
||||
}
|
||||
var whatevs: * = 1001;
|
||||
~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var ques: ? = 'what';
|
||||
~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var g: function(number, number): number = (n,m) => n + m;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var variadic: ...boolean = [true, false, true];
|
||||
~~~~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var most: !string = 'definite';
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var weird1: new:string = {};
|
||||
~~~~~~
|
||||
!!! error TS2322: Type '{}' is not assignable to type 'string'.
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var weird2: this:string = {};
|
||||
~~~~~~
|
||||
!!! error TS2322: Type '{}' is not assignable to type 'string'.
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var postfixdef: number! = 101;
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
var postfixopt: number? = undefined;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2322: Type 'undefined' is not assignable to type 'number | null'.
|
||||
~~~~~~~
|
||||
!!! error TS8020: JSDoc types can only be used inside documentation comments.
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
tests/cases/conformance/jsdoc/jsdocInTypescript2.ts(2,27): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsdoc/jsdocInTypescript2.ts (1 errors) ====
|
||||
// parse error (blocks grammar errors from checker)
|
||||
function parse1(n: number=) { }
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/jsdoc/jsdocParseErrorsInTypescript.ts(2,27): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsdoc/jsdocParseErrorsInTypescript.ts (1 errors) ====
|
||||
// parse error (blocks grammar errors from checker)
|
||||
function parse1(n: number=) { }
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//// [jsdocInTypescript2.ts]
|
||||
//// [jsdocParseErrorsInTypescript.ts]
|
||||
// parse error (blocks grammar errors from checker)
|
||||
function parse1(n: number=) { }
|
||||
|
||||
|
||||
//// [jsdocInTypescript2.js]
|
||||
//// [jsdocParseErrorsInTypescript.js]
|
||||
// parse error (blocks grammar errors from checker)
|
||||
function parse1(n) {
|
||||
if (n === void 0) { n = ; }
|
||||
@@ -17,7 +17,5 @@ var ques: ? = 'what';
|
||||
var g: function(number, number): number = (n,m) => n + m;
|
||||
var variadic: ...boolean = [true, false, true];
|
||||
var most: !string = 'definite';
|
||||
var weird1: new:string = {};
|
||||
var weird2: this:string = {};
|
||||
var postfixdef: number! = 101;
|
||||
var postfixopt: number? = undefined;
|
||||
@@ -3,8 +3,8 @@
|
||||
// @allowJs: true
|
||||
// @Filename: Foo.js
|
||||
/////** @type {function (new: string, string): string} */
|
||||
////var f = function (s) { return /**/; }
|
||||
////var f = function () { return new/**/; }
|
||||
|
||||
goTo.marker();
|
||||
verify.completionListCount(115);
|
||||
verify.completionListContains('new', 'new', '', 'keyword');
|
||||
verify.completionListContains('new');
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
// @allowJs: true
|
||||
// @Filename: Foo.js
|
||||
/////** @type {function (this: string, string): string} */
|
||||
////var f = function (s) { return /**/; }
|
||||
////var f = function (s) { return this/**/; }
|
||||
|
||||
goTo.marker();
|
||||
verify.completionListCount(115);
|
||||
verify.completionListCount(116);
|
||||
verify.completionListContains('this');
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
///<reference path="fourslash.ts" />
|
||||
// @allowJs: true
|
||||
// @Filename: Foo.js
|
||||
/////** @type {function ([|new|]: string, string): string} */
|
||||
/////** @type {function ([|{|"isWriteAccess": true, "isDefinition": true|}new|]: string, string): string} */
|
||||
////var f;
|
||||
|
||||
const [a0] = test.ranges();
|
||||
// should be: verify.referenceGroups([a0], [{ definition: "new", ranges: [a0] }]);
|
||||
verify.referenceGroups([a0], undefined);
|
||||
verify.singleReferenceGroup("(parameter) new: string", [a0]);
|
||||
|
||||
Reference in New Issue
Block a user