Skip to content

Commit 22c5c89

Browse files
committed
Accept baselines
1 parent 11ff822 commit 22c5c89

File tree

125 files changed

+375
-649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+375
-649
lines changed

tests/baselines/reference/ES5SymbolProperty1.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ var Symbol: SymbolConstructor;
1111
> : ^^^^^^^^^^^^^^^^^
1212

1313
var obj = {
14-
>obj : { [x: string]: number; }
15-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
16-
>{ [Symbol.foo]: 0} : { [x: string]: number; }
17-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
14+
>obj : { [Symbol.foo]: number; }
15+
> : ^^ ^^^^^^ ^^
16+
>{ [Symbol.foo]: 0} : { [Symbol.foo]: number; }
17+
> : ^^ ^^^^^^ ^^
1818

1919
[Symbol.foo]: 0
2020
>[Symbol.foo] : number
@@ -32,8 +32,8 @@ var obj = {
3232
obj[Symbol.foo];
3333
>obj[Symbol.foo] : number
3434
> : ^^^^^^
35-
>obj : { [x: string]: number; }
36-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
35+
>obj : { [Symbol.foo]: number; }
36+
> : ^^ ^^^^^^ ^^
3737
>Symbol.foo : string
3838
> : ^^^^^^
3939
>Symbol : SymbolConstructor

tests/baselines/reference/FunctionDeclaration8_es6.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
=== FunctionDeclaration8_es6.ts ===
44
var v = { [yield]: foo }
5-
>v : { [x: number]: any; }
6-
> : ^^^^^^^^^^^^^^^^^^^^^
7-
>{ [yield]: foo } : { [x: number]: any; }
8-
> : ^^^^^^^^^^^^^^^^^^^^^
5+
>v : { [yield]: any; }
6+
> : ^^ ^^^ ^^
7+
>{ [yield]: foo } : { [yield]: any; }
8+
> : ^^ ^^^ ^^
99
>[yield] : any
1010
> : ^^^
1111
>yield : any

tests/baselines/reference/api/typescript.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -6852,11 +6852,15 @@ declare namespace ts {
68526852
String = 0,
68536853
Number = 1,
68546854
}
6855+
type ElementWithComputedPropertyName = (ClassElement | ObjectLiteralElement) & {
6856+
name: ComputedPropertyName;
6857+
};
68556858
interface IndexInfo {
68566859
keyType: Type;
68576860
type: Type;
68586861
isReadonly: boolean;
68596862
declaration?: IndexSignatureDeclaration;
6863+
components?: ElementWithComputedPropertyName[];
68606864
}
68616865
enum InferencePriority {
68626866
None = 0,

tests/baselines/reference/asyncFunctionDeclaration8_es2017.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
=== asyncFunctionDeclaration8_es2017.ts ===
44
var v = { [await]: foo }
5-
>v : { [x: number]: any; }
6-
> : ^^^^^^^^^^^^^^^^^^^^^
7-
>{ [await]: foo } : { [x: number]: any; }
8-
> : ^^^^^^^^^^^^^^^^^^^^^
5+
>v : { [await]: any; }
6+
> : ^^ ^^^ ^^
7+
>{ [await]: foo } : { [await]: any; }
8+
> : ^^ ^^^ ^^
99
>[await] : any
1010
> : ^^^
1111
>await : any

tests/baselines/reference/asyncFunctionDeclaration8_es5.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
=== asyncFunctionDeclaration8_es5.ts ===
44
var v = { [await]: foo }
5-
>v : { [x: number]: any; }
6-
> : ^^^^^^^^^^^^^^^^^^^^^
7-
>{ [await]: foo } : { [x: number]: any; }
8-
> : ^^^^^^^^^^^^^^^^^^^^^
5+
>v : { [await]: any; }
6+
> : ^^ ^^^ ^^
7+
>{ [await]: foo } : { [await]: any; }
8+
> : ^^ ^^^ ^^
99
>[await] : any
1010
> : ^^^
1111
>await : any

tests/baselines/reference/asyncFunctionDeclaration8_es6.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
=== asyncFunctionDeclaration8_es6.ts ===
44
var v = { [await]: foo }
5-
>v : { [x: number]: any; }
6-
> : ^^^^^^^^^^^^^^^^^^^^^
7-
>{ [await]: foo } : { [x: number]: any; }
8-
> : ^^^^^^^^^^^^^^^^^^^^^
5+
>v : { [await]: any; }
6+
> : ^^ ^^^ ^^
7+
>{ [await]: foo } : { [await]: any; }
8+
> : ^^ ^^^ ^^
99
>[await] : any
1010
> : ^^^
1111
>await : any

tests/baselines/reference/capturedParametersInInitializers1.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ function foo8(y = (async () => z)(), z = 1) {
177177

178178
// error - used as computed name of method
179179
function foo9(y = {[z]() { return z; }}, z = 1) {
180-
>foo9 : (y?: { [x: number]: () => number; }, z?: number) => void
181-
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
182-
>y : { [x: number]: () => number; }
183-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184-
>{[z]() { return z; }} : { [x: number]: () => number; }
185-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
180+
>foo9 : (y?: { [z]: () => number; }, z?: number) => void
181+
> : ^ ^^^^^ ^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^
182+
>y : { [z]: () => number; }
183+
> : ^^ ^^^^^^^^^^^^ ^^
184+
>{[z]() { return z; }} : { [z]: () => number; }
185+
> : ^^ ^^^^^^^^^^^^ ^^
186186
>[z] : () => number
187187
> : ^^^^^^^^^^^^
188188
>z : number

tests/baselines/reference/capturedParametersInInitializers2.errors.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
capturedParametersInInitializers2.ts(3,20): error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
22
capturedParametersInInitializers2.ts(4,14): error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
33
capturedParametersInInitializers2.ts(6,10): error TS2373: Parameter 'y' cannot reference identifier 'z' declared after it.
4-
capturedParametersInInitializers2.ts(13,26): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
54
capturedParametersInInitializers2.ts(13,27): error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
65

76

8-
==== capturedParametersInInitializers2.ts (5 errors) ====
7+
==== capturedParametersInInitializers2.ts (4 errors) ====
98
function foo(
109
y = class {
1110
static c = x;
@@ -25,8 +24,6 @@ capturedParametersInInitializers2.ts(13,27): error TS2373: Parameter 'y' cannot
2524
y.c
2625
}
2726
function foo2(y = class {[x] = x}, x = 1) {
28-
~~~
29-
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
3027
~
3128
!!! error TS2373: Parameter 'y' cannot reference identifier 'x' declared after it.
3229
}

tests/baselines/reference/checkJsObjectLiteralIndexSignatures.types

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ let s = `${n}`;
2424
> : ^^^^^^
2525

2626
const numericIndex = { [n]: 1 };
27-
>numericIndex : { [x: number]: number; }
28-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
29-
>{ [n]: 1 } : { [x: number]: number; }
30-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
27+
>numericIndex : { [n]: number; }
28+
> : ^^ ^^^^^^ ^^
29+
>{ [n]: 1 } : { [n]: number; }
30+
> : ^^ ^^^^^^ ^^
3131
>[n] : number
3232
> : ^^^^^^
3333
>n : number
@@ -42,18 +42,18 @@ numericIndex[n].toFixed();
4242
> : ^ ^^^ ^^^^^
4343
>numericIndex[n] : number
4444
> : ^^^^^^
45-
>numericIndex : { [x: number]: number; }
46-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
45+
>numericIndex : { [n]: number; }
46+
> : ^^ ^^^^^^ ^^
4747
>n : number
4848
> : ^^^^^^
4949
>toFixed : (fractionDigits?: number) => string
5050
> : ^ ^^^ ^^^^^
5151

5252
const stringIndex = { [s]: 1 };
53-
>stringIndex : { [x: string]: number; }
54-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
55-
>{ [s]: 1 } : { [x: string]: number; }
56-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
53+
>stringIndex : { [s]: number; }
54+
> : ^^ ^^^^^^ ^^
55+
>{ [s]: 1 } : { [s]: number; }
56+
> : ^^ ^^^^^^ ^^
5757
>[s] : number
5858
> : ^^^^^^
5959
>s : string
@@ -68,8 +68,8 @@ stringIndex[s].toFixed();
6868
> : ^ ^^^ ^^^^^
6969
>stringIndex[s] : number
7070
> : ^^^^^^
71-
>stringIndex : { [x: string]: number; }
72-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
71+
>stringIndex : { [s]: number; }
72+
> : ^^ ^^^^^^ ^^
7373
>s : string
7474
> : ^^^^^^
7575
>toFixed : (fractionDigits?: number) => string

tests/baselines/reference/classNonUniqueSymbolMethodHasSymbolIndexer.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ export const Mixer = Mix(class {
2727

2828

2929
//// [classNonUniqueSymbolMethodHasSymbolIndexer.d.ts]
30+
declare const a: symbol;
3031
export declare class A {
31-
[x: symbol]: () => number;
32+
[a]: () => number;
3233
}
3334
export declare const Mixer: {
3435
new (): {
35-
[x: symbol]: () => number;
36+
[a]: () => number;
3637
};
3738
} & (new (...args: any[]) => {
3839
mixed: true;
3940
});
41+
export {};

tests/baselines/reference/commaOperatorInConditionalExpression.types

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function f (m: string) {
88
> : ^^^^^^
99

1010
[1, 2, 3].map(i => {
11-
>[1, 2, 3].map(i => { return true? { [m]: i } : { [m]: i + 1 } }) : { [x: string]: number; }[]
12-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
11+
>[1, 2, 3].map(i => { return true? { [m]: i } : { [m]: i + 1 } }) : { [m]: number; }[]
12+
> : ^^ ^^^^^^ ^^^^
1313
>[1, 2, 3].map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
1414
> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^
1515
>[1, 2, 3] : number[]
@@ -22,26 +22,26 @@ function f (m: string) {
2222
> : ^
2323
>map : <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]
2424
> : ^ ^^ ^^^ ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^
25-
>i => { return true? { [m]: i } : { [m]: i + 1 } } : (i: number) => { [x: string]: number; }
26-
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
>i => { return true? { [m]: i } : { [m]: i + 1 } } : (i: number) => { [m]: number; }
26+
> : ^ ^^^^^^^^^^^^^^^ ^^^^^^ ^^
2727
>i : number
2828
> : ^^^^^^
2929

3030
return true? { [m]: i } : { [m]: i + 1 }
31-
>true? { [m]: i } : { [m]: i + 1 } : { [x: string]: number; }
32-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
31+
>true? { [m]: i } : { [m]: i + 1 } : { [m]: number; }
32+
> : ^^ ^^^^^^ ^^
3333
>true : true
3434
> : ^^^^
35-
>{ [m]: i } : { [x: string]: number; }
36-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
35+
>{ [m]: i } : { [m]: number; }
36+
> : ^^ ^^^^^^ ^^
3737
>[m] : number
3838
> : ^^^^^^
3939
>m : string
4040
> : ^^^^^^
4141
>i : number
4242
> : ^^^^^^
43-
>{ [m]: i + 1 } : { [x: string]: number; }
44-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
43+
>{ [m]: i + 1 } : { [m]: number; }
44+
> : ^^ ^^^^^^ ^^
4545
>[m] : number
4646
> : ^^^^^^
4747
>m : string

tests/baselines/reference/complicatedPrivacy.errors.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
complicatedPrivacy.ts(11,24): error TS1054: A 'get' accessor cannot have parameters.
2-
complicatedPrivacy.ts(35,5): error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.
32
complicatedPrivacy.ts(35,6): error TS2693: 'number' only refers to a type, but is being used as a value here.
43
complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported member 'i6'.
54

65

7-
==== complicatedPrivacy.ts (4 errors) ====
6+
==== complicatedPrivacy.ts (3 errors) ====
87
module m1 {
98
export module m2 {
109

@@ -42,8 +41,6 @@ complicatedPrivacy.ts(73,55): error TS2694: Namespace 'mglo5' has no exported me
4241
export function f4(arg1:
4342
{
4443
[number]: C1; // Used to be indexer, now it is a computed property
45-
~~~~~~~~
46-
!!! error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.
4744
~~~~~~
4845
!!! error TS2693: 'number' only refers to a type, but is being used as a value here.
4946
}) {

tests/baselines/reference/complicatedPrivacy.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ module m1 {
8686
export function f4(arg1:
8787
>f4 : (arg1: { [number]: C1; }) => void
8888
> : ^ ^^ ^^^^^^^^^
89-
>arg1 : { [x: number]: C1; }
90-
> : ^^^^^^^^^^^^^^^^^^^^
89+
>arg1 : { [number]: C1; }
90+
> : ^^ ^^ ^^
9191
{
9292
[number]: C1; // Used to be indexer, now it is a computed property
9393
>[number] : C1

tests/baselines/reference/computedPropertiesInDestructuring1.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}];
181181
> : ^^^^^^^^^^^^^^^^
182182
>{[foo]: bar} = {bar: "bar"} : { bar: string; }
183183
> : ^^^^^^^^^^^^^^^^
184-
>{[foo]: bar} : { [x: string]: any; }
185-
> : ^^^^^^^^^^^^^^^^^^^^^
184+
>{[foo]: bar} : { [foo]: any; }
185+
> : ^^ ^^^ ^^
186186
>[foo] : any
187187
> : ^^^
188188
>foo : string
@@ -241,10 +241,10 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}];
241241
[{[foo]: bar4}] = [{bar: "bar"}];
242242
>[{[foo]: bar4}] = [{bar: "bar"}] : [{ bar: string; }]
243243
> : ^^^^^^^^^^^^^^^^^^
244-
>[{[foo]: bar4}] : [{ [x: string]: any; }]
245-
> : ^^^^^^^^^^^^^^^^^^^^^^^
246-
>{[foo]: bar4} : { [x: string]: any; }
247-
> : ^^^^^^^^^^^^^^^^^^^^^
244+
>[{[foo]: bar4}] : [{ [foo]: any; }]
245+
> : ^^^ ^^^ ^^^
246+
>{[foo]: bar4} : { [foo]: any; }
247+
> : ^^ ^^^ ^^
248248
>[foo] : any
249249
> : ^^^
250250
>foo : string

tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}];
193193
> : ^^^^^^^^^^^^^^^^
194194
>{[foo]: bar} = {bar: "bar"} : { bar: string; }
195195
> : ^^^^^^^^^^^^^^^^
196-
>{[foo]: bar} : { [x: string]: any; }
197-
> : ^^^^^^^^^^^^^^^^^^^^^
196+
>{[foo]: bar} : { [foo]: any; }
197+
> : ^^ ^^^ ^^
198198
>[foo] : any
199199
> : ^^^
200200
>foo : string
@@ -253,10 +253,10 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}];
253253
[{[foo]: bar4}] = [{bar: "bar"}];
254254
>[{[foo]: bar4}] = [{bar: "bar"}] : [{ bar: string; }]
255255
> : ^^^^^^^^^^^^^^^^^^
256-
>[{[foo]: bar4}] : [{ [x: string]: any; }]
257-
> : ^^^^^^^^^^^^^^^^^^^^^^^
258-
>{[foo]: bar4} : { [x: string]: any; }
259-
> : ^^^^^^^^^^^^^^^^^^^^^
256+
>[{[foo]: bar4}] : [{ [foo]: any; }]
257+
> : ^^^ ^^^ ^^^
258+
>{[foo]: bar4} : { [foo]: any; }
259+
> : ^^ ^^^ ^^
260260
>[foo] : any
261261
> : ^^^
262262
>foo : string

tests/baselines/reference/computedPropertiesNarrowed.errors.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
computedPropertiesNarrowed.ts(5,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
22
computedPropertiesNarrowed.ts(11,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
33
computedPropertiesNarrowed.ts(18,20): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
4+
computedPropertiesNarrowed.ts(20,5): error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
45
computedPropertiesNarrowed.ts(22,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
56
computedPropertiesNarrowed.ts(26,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
67
computedPropertiesNarrowed.ts(31,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
@@ -9,7 +10,7 @@ computedPropertiesNarrowed.ts(42,5): error TS9038: Computed property names on cl
910
computedPropertiesNarrowed.ts(47,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.
1011

1112

12-
==== computedPropertiesNarrowed.ts (9 errors) ====
13+
==== computedPropertiesNarrowed.ts (10 errors) ====
1314
const x: 0 | 1 = Math.random()? 0: 1;
1415
declare function assert(n: number): asserts n is 1;
1516
assert(x);
@@ -39,6 +40,9 @@ computedPropertiesNarrowed.ts(47,5): error TS9038: Computed property names on cl
3940
!!! related TS9027 computedPropertiesNarrowed.ts:18:12: Add a type annotation to the variable o32.
4041

4142
let u = Symbol();
43+
~
44+
!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
45+
!!! related TS9027 computedPropertiesNarrowed.ts:20:5: Add a type annotation to the variable u.
4246
export let o4 = {
4347
[u]: 1 // Should error, nut a unique symbol
4448
~~~

tests/baselines/reference/computedPropertiesNarrowed.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ let u = Symbol();
122122
> : ^^^^^^^^^^^^^^^^^
123123

124124
export let o4 = {
125-
>o4 : { [x: symbol]: number; }
126-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
127-
>{ [u]: 1 // Should error, nut a unique symbol} : { [x: symbol]: number; }
128-
> : ^^^^^^^^^^^^^^^^^^^^^^^^
125+
>o4 : { [u]: number; }
126+
> : ^^ ^^^^^^ ^^
127+
>{ [u]: 1 // Should error, nut a unique symbol} : { [u]: number; }
128+
> : ^^ ^^^^^^ ^^
129129

130130
[u]: 1 // Should error, nut a unique symbol
131131
>[u] : number

0 commit comments

Comments
 (0)