Merge pull request #17082 from Microsoft/master-16201
[Master] Fix 16201: fix cannot find "object"
This commit is contained in:
commit
25f4e46638
9 changed files with 84 additions and 4 deletions
|
@ -6892,6 +6892,7 @@ namespace ts {
|
|||
case "Null":
|
||||
return nullType;
|
||||
case "Object":
|
||||
case "object":
|
||||
return anyType;
|
||||
case "Function":
|
||||
case "function":
|
||||
|
|
|
@ -28,7 +28,17 @@ x1(0);
|
|||
|
||||
/** @type {function (number): number} */
|
||||
const x2 = (a) => a + 1;
|
||||
x2(0);
|
||||
x2(0);
|
||||
|
||||
/**
|
||||
* @type {object}
|
||||
*/
|
||||
var props = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
var props = {};
|
||||
|
||||
//// [0.js]
|
||||
// @ts-check
|
||||
|
@ -54,3 +64,11 @@ x1(0);
|
|||
/** @type {function (number): number} */
|
||||
var x2 = function (a) { return a + 1; };
|
||||
x2(0);
|
||||
/**
|
||||
* @type {object}
|
||||
*/
|
||||
var props = {};
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
var props = {};
|
||||
|
|
|
@ -58,3 +58,15 @@ const x2 = (a) => a + 1;
|
|||
x2(0);
|
||||
>x2 : Symbol(x2, Decl(0.js, 28, 5))
|
||||
|
||||
/**
|
||||
* @type {object}
|
||||
*/
|
||||
var props = {};
|
||||
>props : Symbol(props, Decl(0.js, 34, 3), Decl(0.js, 39, 3))
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
var props = {};
|
||||
>props : Symbol(props, Decl(0.js, 34, 3), Decl(0.js, 39, 3))
|
||||
|
||||
|
|
|
@ -86,3 +86,17 @@ x2(0);
|
|||
>x2 : (arg0: number) => number
|
||||
>0 : 0
|
||||
|
||||
/**
|
||||
* @type {object}
|
||||
*/
|
||||
var props = {};
|
||||
>props : any
|
||||
>{} : {}
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
var props = {};
|
||||
>props : any
|
||||
>{} : {}
|
||||
|
||||
|
|
|
@ -55,6 +55,9 @@ var nullable;
|
|||
/** @type {Object} */
|
||||
var Obj;
|
||||
|
||||
/** @type {object} */
|
||||
var obj;
|
||||
|
||||
/** @type {Function} */
|
||||
var Func;
|
||||
|
||||
|
@ -77,6 +80,7 @@ var P: Promise<any>;
|
|||
var p: Promise<any>;
|
||||
var nullable: number | null;
|
||||
var Obj: any;
|
||||
var obj: any;
|
||||
var Func: Function;
|
||||
|
||||
|
||||
|
@ -117,6 +121,8 @@ var p;
|
|||
var nullable;
|
||||
/** @type {Object} */
|
||||
var Obj;
|
||||
/** @type {object} */
|
||||
var obj;
|
||||
/** @type {Function} */
|
||||
var Func;
|
||||
//// [b.js]
|
||||
|
@ -138,4 +144,5 @@ var P;
|
|||
var p;
|
||||
var nullable;
|
||||
var Obj;
|
||||
var obj;
|
||||
var Func;
|
||||
|
|
|
@ -71,9 +71,13 @@ var nullable;
|
|||
var Obj;
|
||||
>Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3))
|
||||
|
||||
/** @type {object} */
|
||||
var obj;
|
||||
>obj : Symbol(obj, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
|
||||
|
||||
/** @type {Function} */
|
||||
var Func;
|
||||
>Func : Symbol(Func, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
|
||||
>Func : Symbol(Func, Decl(a.js, 58, 3), Decl(b.ts, 19, 3))
|
||||
|
||||
=== tests/cases/conformance/jsdoc/b.ts ===
|
||||
var S: string;
|
||||
|
@ -132,7 +136,10 @@ var nullable: number | null;
|
|||
var Obj: any;
|
||||
>Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3))
|
||||
|
||||
var obj: any;
|
||||
>obj : Symbol(obj, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
|
||||
|
||||
var Func: Function;
|
||||
>Func : Symbol(Func, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
|
||||
>Func : Symbol(Func, Decl(a.js, 58, 3), Decl(b.ts, 19, 3))
|
||||
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
|
|
|
@ -71,6 +71,10 @@ var nullable;
|
|||
var Obj;
|
||||
>Obj : any
|
||||
|
||||
/** @type {object} */
|
||||
var obj;
|
||||
>obj : any
|
||||
|
||||
/** @type {Function} */
|
||||
var Func;
|
||||
>Func : Function
|
||||
|
@ -135,6 +139,9 @@ var nullable: number | null;
|
|||
var Obj: any;
|
||||
>Obj : any
|
||||
|
||||
var obj: any;
|
||||
>obj : any
|
||||
|
||||
var Func: Function;
|
||||
>Func : Function
|
||||
>Function : Function
|
||||
|
|
|
@ -31,4 +31,14 @@ x1(0);
|
|||
|
||||
/** @type {function (number): number} */
|
||||
const x2 = (a) => a + 1;
|
||||
x2(0);
|
||||
x2(0);
|
||||
|
||||
/**
|
||||
* @type {object}
|
||||
*/
|
||||
var props = {};
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
var props = {};
|
|
@ -57,6 +57,9 @@ var nullable;
|
|||
/** @type {Object} */
|
||||
var Obj;
|
||||
|
||||
/** @type {object} */
|
||||
var obj;
|
||||
|
||||
/** @type {Function} */
|
||||
var Func;
|
||||
|
||||
|
@ -79,4 +82,5 @@ var P: Promise<any>;
|
|||
var p: Promise<any>;
|
||||
var nullable: number | null;
|
||||
var Obj: any;
|
||||
var obj: any;
|
||||
var Func: Function;
|
||||
|
|
Loading…
Reference in a new issue