Skip to content

Commit 587ba8d

Browse files
committed
Test:spreading any doesn't set flags on anyType
And update baselines
1 parent 8dc1747 commit 587ba8d

5 files changed

+39
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//// [explicitAnyAfterSpreadNoImplicitAnyError.ts]
2+
({ a: [], ...(null as any) });
3+
let x: any;
4+
5+
6+
//// [explicitAnyAfterSpreadNoImplicitAnyError.js]
7+
var __assign = (this && this.__assign) || Object.assign || function(t) {
8+
for (var s, i = 1, n = arguments.length; i < n; i++) {
9+
s = arguments[i];
10+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11+
t[p] = s[p];
12+
}
13+
return t;
14+
};
15+
(__assign({ a: [] }, null));
16+
var x;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
=== tests/cases/compiler/explicitAnyAfterSpreadNoImplicitAnyError.ts ===
2+
({ a: [], ...(null as any) });
3+
>a : Symbol(a, Decl(explicitAnyAfterSpreadNoImplicitAnyError.ts, 0, 2))
4+
5+
let x: any;
6+
>x : Symbol(x, Decl(explicitAnyAfterSpreadNoImplicitAnyError.ts, 1, 3))
7+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=== tests/cases/compiler/explicitAnyAfterSpreadNoImplicitAnyError.ts ===
2+
({ a: [], ...(null as any) });
3+
>({ a: [], ...(null as any) }) : any
4+
>{ a: [], ...(null as any) } : any
5+
>a : undefined[]
6+
>[] : undefined[]
7+
>(null as any) : any
8+
>null as any : any
9+
>null : null
10+
11+
let x: any;
12+
>x : any
13+

tests/baselines/reference/objectSpread.symbols

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ let cplus: { p: number, plus(): void } = { ...c, plus() { return this.p + 1; } }
200200
>plus : Symbol(plus, Decl(objectSpread.ts, 49, 23))
201201
>c : Symbol(c, Decl(objectSpread.ts, 45, 3))
202202
>plus : Symbol(plus, Decl(objectSpread.ts, 49, 48))
203-
>this : Symbol(__object, Decl(objectSpread.ts, 41, 15))
204203

205204
cplus.plus();
206205
>cplus.plus : Symbol(plus, Decl(objectSpread.ts, 49, 23))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// @noImplicitAny: true
2+
({ a: [], ...(null as any) });
3+
let x: any;

0 commit comments

Comments
 (0)