Skip to content

Commit 5eb70f8

Browse files
committed
Rename test to better reflect result
1 parent 7d0aa5c commit 5eb70f8

6 files changed

+139
-139
lines changed

tests/baselines/reference/destructuringThisWithProperty.symbols

-118
This file was deleted.

tests/baselines/reference/destructuringThisWithProperty.errors.txt renamed to tests/baselines/reference/destructuringUnspreadableIntoRest.errors.txt

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
tests/cases/compiler/destructuringThisWithProperty.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2-
tests/cases/compiler/destructuringThisWithProperty.ts(14,15): error TS2339: Property 'bar' does not exist on type 'Omit<this, "bar" | "func">'.
3-
tests/cases/compiler/destructuringThisWithProperty.ts(15,15): error TS2339: Property 'bar' does not exist on type '{ foo: string; }'.
4-
tests/cases/compiler/destructuringThisWithProperty.ts(16,15): error TS2339: Property 'bar' does not exist on type 'Omit<this, "foo" | "bar" | "func">'.
5-
tests/cases/compiler/destructuringThisWithProperty.ts(17,15): error TS2339: Property 'bar' does not exist on type '{}'.
6-
tests/cases/compiler/destructuringThisWithProperty.ts(19,15): error TS2339: Property 'func' does not exist on type 'Omit<this, "bar" | "func">'.
7-
tests/cases/compiler/destructuringThisWithProperty.ts(20,15): error TS2339: Property 'func' does not exist on type '{ foo: string; }'.
8-
tests/cases/compiler/destructuringThisWithProperty.ts(21,15): error TS2339: Property 'func' does not exist on type 'Omit<this, "foo" | "bar" | "func">'.
9-
tests/cases/compiler/destructuringThisWithProperty.ts(22,15): error TS2339: Property 'func' does not exist on type '{}'.
10-
tests/cases/compiler/destructuringThisWithProperty.ts(32,11): error TS2339: Property 'bar' does not exist on type 'Omit<T, "bar" | "func">'.
11-
tests/cases/compiler/destructuringThisWithProperty.ts(33,11): error TS2339: Property 'bar' does not exist on type '{ foo: string; }'.
12-
tests/cases/compiler/destructuringThisWithProperty.ts(34,11): error TS2339: Property 'bar' does not exist on type 'Omit<T, "foo" | "bar" | "func">'.
13-
tests/cases/compiler/destructuringThisWithProperty.ts(35,11): error TS2339: Property 'bar' does not exist on type '{}'.
14-
tests/cases/compiler/destructuringThisWithProperty.ts(37,11): error TS2339: Property 'func' does not exist on type 'Omit<T, "bar" | "func">'.
15-
tests/cases/compiler/destructuringThisWithProperty.ts(38,11): error TS2339: Property 'func' does not exist on type '{ foo: string; }'.
16-
tests/cases/compiler/destructuringThisWithProperty.ts(39,11): error TS2339: Property 'func' does not exist on type 'Omit<T, "foo" | "bar" | "func">'.
17-
tests/cases/compiler/destructuringThisWithProperty.ts(40,11): error TS2339: Property 'func' does not exist on type '{}'.
1+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(14,15): error TS2339: Property 'bar' does not exist on type 'Omit<this, "bar" | "func">'.
3+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(15,15): error TS2339: Property 'bar' does not exist on type '{ foo: string; }'.
4+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(16,15): error TS2339: Property 'bar' does not exist on type 'Omit<this, "foo" | "bar" | "func">'.
5+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(17,15): error TS2339: Property 'bar' does not exist on type '{}'.
6+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(19,15): error TS2339: Property 'func' does not exist on type 'Omit<this, "bar" | "func">'.
7+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(20,15): error TS2339: Property 'func' does not exist on type '{ foo: string; }'.
8+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(21,15): error TS2339: Property 'func' does not exist on type 'Omit<this, "foo" | "bar" | "func">'.
9+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(22,15): error TS2339: Property 'func' does not exist on type '{}'.
10+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(32,11): error TS2339: Property 'bar' does not exist on type 'Omit<T, "bar" | "func">'.
11+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(33,11): error TS2339: Property 'bar' does not exist on type '{ foo: string; }'.
12+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(34,11): error TS2339: Property 'bar' does not exist on type 'Omit<T, "foo" | "bar" | "func">'.
13+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(35,11): error TS2339: Property 'bar' does not exist on type '{}'.
14+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(37,11): error TS2339: Property 'func' does not exist on type 'Omit<T, "bar" | "func">'.
15+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(38,11): error TS2339: Property 'func' does not exist on type '{ foo: string; }'.
16+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(39,11): error TS2339: Property 'func' does not exist on type 'Omit<T, "foo" | "bar" | "func">'.
17+
tests/cases/compiler/destructuringUnspreadableIntoRest.ts(40,11): error TS2339: Property 'func' does not exist on type '{}'.
1818

1919

20-
==== tests/cases/compiler/destructuringThisWithProperty.ts (17 errors) ====
20+
==== tests/cases/compiler/destructuringUnspreadableIntoRest.ts (17 errors) ====
2121
class A {
2222
constructor(public foo: string) {}
2323

tests/baselines/reference/destructuringThisWithProperty.js renamed to tests/baselines/reference/destructuringUnspreadableIntoRest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//// [destructuringThisWithProperty.ts]
1+
//// [destructuringUnspreadableIntoRest.ts]
22
class A {
33
constructor(public foo: string) {}
44

@@ -42,7 +42,7 @@ function destructure<T extends A>(x: T) {
4242
}
4343

4444

45-
//// [destructuringThisWithProperty.js]
45+
//// [destructuringUnspreadableIntoRest.js]
4646
var __rest = (this && this.__rest) || function (s, e) {
4747
var t = {};
4848
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
=== tests/cases/compiler/destructuringUnspreadableIntoRest.ts ===
2+
class A {
3+
>A : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
4+
5+
constructor(public foo: string) {}
6+
>foo : Symbol(A.foo, Decl(destructuringUnspreadableIntoRest.ts, 1, 16))
7+
8+
get bar(): number {
9+
>bar : Symbol(A.bar, Decl(destructuringUnspreadableIntoRest.ts, 1, 38))
10+
11+
return 1;
12+
}
13+
14+
func() {
15+
>func : Symbol(A.func, Decl(destructuringUnspreadableIntoRest.ts, 5, 5))
16+
17+
const { ...rest1 } = this;
18+
>rest1 : Symbol(rest1, Decl(destructuringUnspreadableIntoRest.ts, 8, 15))
19+
>this : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
20+
21+
const { ...rest2 } = this as A;
22+
>rest2 : Symbol(rest2, Decl(destructuringUnspreadableIntoRest.ts, 9, 15))
23+
>this : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
24+
>A : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
25+
26+
const { foo: _f1, ...rest3 } = this;
27+
>foo : Symbol(A.foo, Decl(destructuringUnspreadableIntoRest.ts, 1, 16))
28+
>_f1 : Symbol(_f1, Decl(destructuringUnspreadableIntoRest.ts, 10, 15))
29+
>rest3 : Symbol(rest3, Decl(destructuringUnspreadableIntoRest.ts, 10, 25))
30+
>this : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
31+
32+
const { foo: _f2, ...rest4 } = this as A;
33+
>foo : Symbol(A.foo, Decl(destructuringUnspreadableIntoRest.ts, 1, 16))
34+
>_f2 : Symbol(_f2, Decl(destructuringUnspreadableIntoRest.ts, 11, 15))
35+
>rest4 : Symbol(rest4, Decl(destructuringUnspreadableIntoRest.ts, 11, 25))
36+
>this : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
37+
>A : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
38+
39+
rest1.bar;
40+
>rest1 : Symbol(rest1, Decl(destructuringUnspreadableIntoRest.ts, 8, 15))
41+
42+
rest2.bar;
43+
>rest2 : Symbol(rest2, Decl(destructuringUnspreadableIntoRest.ts, 9, 15))
44+
45+
rest3.bar;
46+
>rest3 : Symbol(rest3, Decl(destructuringUnspreadableIntoRest.ts, 10, 25))
47+
48+
rest4.bar;
49+
>rest4 : Symbol(rest4, Decl(destructuringUnspreadableIntoRest.ts, 11, 25))
50+
51+
rest1.func;
52+
>rest1 : Symbol(rest1, Decl(destructuringUnspreadableIntoRest.ts, 8, 15))
53+
54+
rest2.func;
55+
>rest2 : Symbol(rest2, Decl(destructuringUnspreadableIntoRest.ts, 9, 15))
56+
57+
rest3.func;
58+
>rest3 : Symbol(rest3, Decl(destructuringUnspreadableIntoRest.ts, 10, 25))
59+
60+
rest4.func;
61+
>rest4 : Symbol(rest4, Decl(destructuringUnspreadableIntoRest.ts, 11, 25))
62+
}
63+
}
64+
65+
function destructure<T extends A>(x: T) {
66+
>destructure : Symbol(destructure, Decl(destructuringUnspreadableIntoRest.ts, 23, 1))
67+
>T : Symbol(T, Decl(destructuringUnspreadableIntoRest.ts, 25, 21))
68+
>A : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
69+
>x : Symbol(x, Decl(destructuringUnspreadableIntoRest.ts, 25, 34))
70+
>T : Symbol(T, Decl(destructuringUnspreadableIntoRest.ts, 25, 21))
71+
72+
const { ...rest1 } = x;
73+
>rest1 : Symbol(rest1, Decl(destructuringUnspreadableIntoRest.ts, 26, 11))
74+
>x : Symbol(x, Decl(destructuringUnspreadableIntoRest.ts, 25, 34))
75+
76+
const { ...rest2 } = x as A;
77+
>rest2 : Symbol(rest2, Decl(destructuringUnspreadableIntoRest.ts, 27, 11))
78+
>x : Symbol(x, Decl(destructuringUnspreadableIntoRest.ts, 25, 34))
79+
>A : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
80+
81+
const { foo: _f1, ...rest3 } = x;
82+
>foo : Symbol(A.foo, Decl(destructuringUnspreadableIntoRest.ts, 1, 16))
83+
>_f1 : Symbol(_f1, Decl(destructuringUnspreadableIntoRest.ts, 28, 11))
84+
>rest3 : Symbol(rest3, Decl(destructuringUnspreadableIntoRest.ts, 28, 21))
85+
>x : Symbol(x, Decl(destructuringUnspreadableIntoRest.ts, 25, 34))
86+
87+
const { foo: _f2, ...rest4 } = x as A;
88+
>foo : Symbol(A.foo, Decl(destructuringUnspreadableIntoRest.ts, 1, 16))
89+
>_f2 : Symbol(_f2, Decl(destructuringUnspreadableIntoRest.ts, 29, 11))
90+
>rest4 : Symbol(rest4, Decl(destructuringUnspreadableIntoRest.ts, 29, 21))
91+
>x : Symbol(x, Decl(destructuringUnspreadableIntoRest.ts, 25, 34))
92+
>A : Symbol(A, Decl(destructuringUnspreadableIntoRest.ts, 0, 0))
93+
94+
rest1.bar;
95+
>rest1 : Symbol(rest1, Decl(destructuringUnspreadableIntoRest.ts, 26, 11))
96+
97+
rest2.bar;
98+
>rest2 : Symbol(rest2, Decl(destructuringUnspreadableIntoRest.ts, 27, 11))
99+
100+
rest3.bar;
101+
>rest3 : Symbol(rest3, Decl(destructuringUnspreadableIntoRest.ts, 28, 21))
102+
103+
rest4.bar;
104+
>rest4 : Symbol(rest4, Decl(destructuringUnspreadableIntoRest.ts, 29, 21))
105+
106+
rest1.func;
107+
>rest1 : Symbol(rest1, Decl(destructuringUnspreadableIntoRest.ts, 26, 11))
108+
109+
rest2.func;
110+
>rest2 : Symbol(rest2, Decl(destructuringUnspreadableIntoRest.ts, 27, 11))
111+
112+
rest3.func;
113+
>rest3 : Symbol(rest3, Decl(destructuringUnspreadableIntoRest.ts, 28, 21))
114+
115+
rest4.func;
116+
>rest4 : Symbol(rest4, Decl(destructuringUnspreadableIntoRest.ts, 29, 21))
117+
}
118+

tests/baselines/reference/destructuringThisWithProperty.types renamed to tests/baselines/reference/destructuringUnspreadableIntoRest.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== tests/cases/compiler/destructuringThisWithProperty.ts ===
1+
=== tests/cases/compiler/destructuringUnspreadableIntoRest.ts ===
22
class A {
33
>A : A
44

0 commit comments

Comments
 (0)