mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Test that rest of untyped binding pattern is any
This commit is contained in:
@@ -36,6 +36,8 @@ let computed = 'b';
|
||||
let computed2 = 'a';
|
||||
var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
|
||||
({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o);
|
||||
|
||||
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber;
|
||||
|
||||
|
||||
//// [objectRest.js]
|
||||
@@ -76,4 +78,8 @@ let computed = 'b';
|
||||
let computed2 = 'a';
|
||||
var _g = computed, stillNotGreat = o[_g], _h = computed2, soSo = o[_h], o = __rest(o, [typeof _g === "symbol" ? _g : _g + "", typeof _h === "symbol" ? _h : _h + ""]);
|
||||
(_j = computed, stillNotGreat = o[_j], _k = computed2, soSo = o[_k], o = __rest(o, [typeof _j === "symbol" ? _j : _j + "", typeof _k === "symbol" ? _k : _k + ""]));
|
||||
var noContextualType = (_a) => {
|
||||
var { aNumber = 12 } = _a, notEmptyObject = __rest(_a, ["aNumber"]);
|
||||
return aNumber;
|
||||
};
|
||||
var _d, _f, _j, _k;
|
||||
|
||||
@@ -169,3 +169,9 @@ var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
|
||||
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
|
||||
>o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 35, 51))
|
||||
|
||||
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber;
|
||||
>noContextualType : Symbol(noContextualType, Decl(objectRest.ts, 38, 3))
|
||||
>aNumber : Symbol(aNumber, Decl(objectRest.ts, 38, 25))
|
||||
>notEmptyObject : Symbol(notEmptyObject, Decl(objectRest.ts, 38, 39))
|
||||
>aNumber : Symbol(aNumber, Decl(objectRest.ts, 38, 25))
|
||||
|
||||
|
||||
@@ -195,3 +195,11 @@ var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
|
||||
>o : { a: number; b: string; }
|
||||
>o : { a: number; b: string; }
|
||||
|
||||
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber;
|
||||
>noContextualType : ({aNumber, ...notEmptyObject}: { aNumber?: number; }) => number
|
||||
>({ aNumber = 12, ...notEmptyObject }) => aNumber : ({aNumber, ...notEmptyObject}: { aNumber?: number; }) => number
|
||||
>aNumber : number
|
||||
>12 : 12
|
||||
>notEmptyObject : any
|
||||
>aNumber : number
|
||||
|
||||
|
||||
@@ -36,3 +36,5 @@ let computed = 'b';
|
||||
let computed2 = 'a';
|
||||
var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
|
||||
({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o);
|
||||
|
||||
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber;
|
||||
|
||||
Reference in New Issue
Block a user