Skip to content

Commit 3cc3b49

Browse files
committed
Accept new baselines
1 parent 9cd8ead commit 3cc3b49

8 files changed

+27
-17
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,7 @@ declare namespace ts {
14791479
}
14801480
interface SyntheticExpression extends Expression {
14811481
kind: SyntaxKind.SyntheticExpression;
1482+
isSpread: boolean;
14821483
type: Type;
14831484
}
14841485
type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
@@ -5048,6 +5049,8 @@ declare namespace ts {
50485049
_0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag: DiagnosticMessage;
50495050
A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal: DiagnosticMessage;
50505051
A_definite_assignment_assertion_is_not_permitted_in_this_context: DiagnosticMessage;
5052+
A_rest_element_must_be_last_in_a_tuple_type: DiagnosticMessage;
5053+
A_required_element_cannot_follow_an_optional_element: DiagnosticMessage;
50515054
with_statements_are_not_allowed_in_an_async_function_block: DiagnosticMessage;
50525055
await_expression_is_only_allowed_within_an_async_function: DiagnosticMessage;
50535056
can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment: DiagnosticMessage;
@@ -5344,6 +5347,9 @@ declare namespace ts {
53445347
Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: DiagnosticMessage;
53455348
Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await: DiagnosticMessage;
53465349
Object_is_of_type_unknown: DiagnosticMessage;
5350+
Rest_signatures_are_incompatible: DiagnosticMessage;
5351+
Property_0_is_incompatible_with_rest_element_type: DiagnosticMessage;
5352+
A_rest_element_type_must_be_an_array_type: DiagnosticMessage;
53475353
JSX_element_attributes_type_0_may_not_be_a_union_type: DiagnosticMessage;
53485354
The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: DiagnosticMessage;
53495355
JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: DiagnosticMessage;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ declare namespace ts {
888888
}
889889
interface SyntheticExpression extends Expression {
890890
kind: SyntaxKind.SyntheticExpression;
891+
isSpread: boolean;
891892
type: Type;
892893
}
893894
type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;

tests/baselines/reference/genericRestParameters1.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ tests/cases/conformance/types/rest/genericRestParameters1.ts(31,1): error TS2556
5454
function g10<U extends string[], V extends [number, number]>(u: U, v: V) {
5555
let x1 = f10(...u); // U
5656
let x2 = f10(...v); // V
57-
let x3 = f10(1, ...u); // (string | number)[]
57+
let x3 = f10(1, ...u); // [number, ...string[]]
5858
let x4 = f10(...u, ...v); // (string | number)[]
5959
}
6060

@@ -73,7 +73,7 @@ tests/cases/conformance/types/rest/genericRestParameters1.ts(31,1): error TS2556
7373
function g11<U extends string[], V extends [number, number]>(u: U, v: V) {
7474
let x1 = f11(...u); // U
7575
let x2 = f11(...v); // V
76-
let x3 = f11(1, ...u); // (string | 1)[]
76+
let x3 = f11(1, ...u); // [1, ...string[]]
7777
let x4 = f11(...u, ...v); // (string | number)[]
7878
}
7979

tests/baselines/reference/genericRestParameters1.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const x18 = f10(...ns, true); // (string | number | boolean)[]
4646
function g10<U extends string[], V extends [number, number]>(u: U, v: V) {
4747
let x1 = f10(...u); // U
4848
let x2 = f10(...v); // V
49-
let x3 = f10(1, ...u); // (string | number)[]
49+
let x3 = f10(1, ...u); // [number, ...string[]]
5050
let x4 = f10(...u, ...v); // (string | number)[]
5151
}
5252

@@ -65,7 +65,7 @@ const z18 = f11(...ns, true); // (string | number | true)[]
6565
function g11<U extends string[], V extends [number, number]>(u: U, v: V) {
6666
let x1 = f11(...u); // U
6767
let x2 = f11(...v); // V
68-
let x3 = f11(1, ...u); // (string | 1)[]
68+
let x3 = f11(1, ...u); // [1, ...string[]]
6969
let x4 = f11(...u, ...v); // (string | number)[]
7070
}
7171

@@ -187,7 +187,7 @@ var x18 = f10.apply(void 0, ns.concat([true])); // (string | number | boolean)[]
187187
function g10(u, v) {
188188
var x1 = f10.apply(void 0, u); // U
189189
var x2 = f10.apply(void 0, v); // V
190-
var x3 = f10.apply(void 0, [1].concat(u)); // (string | number)[]
190+
var x3 = f10.apply(void 0, [1].concat(u)); // [number, ...string[]]
191191
var x4 = f10.apply(void 0, u.concat(v)); // (string | number)[]
192192
}
193193
var z10 = f11(42, "hello", true); // [42, "hello", true]
@@ -202,7 +202,7 @@ var z18 = f11.apply(void 0, ns.concat([true])); // (string | number | true)[]
202202
function g11(u, v) {
203203
var x1 = f11.apply(void 0, u); // U
204204
var x2 = f11.apply(void 0, v); // V
205-
var x3 = f11.apply(void 0, [1].concat(u)); // (string | 1)[]
205+
var x3 = f11.apply(void 0, [1].concat(u)); // [1, ...string[]]
206206
var x4 = f11.apply(void 0, u.concat(v)); // (string | number)[]
207207
}
208208
function call(f) {

tests/baselines/reference/genericRestParameters1.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function g10<U extends string[], V extends [number, number]>(u: U, v: V) {
180180
>f10 : Symbol(f10, Decl(genericRestParameters1.ts, 30, 16))
181181
>v : Symbol(v, Decl(genericRestParameters1.ts, 44, 66))
182182

183-
let x3 = f10(1, ...u); // (string | number)[]
183+
let x3 = f10(1, ...u); // [number, ...string[]]
184184
>x3 : Symbol(x3, Decl(genericRestParameters1.ts, 47, 7))
185185
>f10 : Symbol(f10, Decl(genericRestParameters1.ts, 30, 16))
186186
>u : Symbol(u, Decl(genericRestParameters1.ts, 44, 61))
@@ -259,7 +259,7 @@ function g11<U extends string[], V extends [number, number]>(u: U, v: V) {
259259
>f11 : Symbol(f11, Decl(genericRestParameters1.ts, 49, 1))
260260
>v : Symbol(v, Decl(genericRestParameters1.ts, 63, 66))
261261

262-
let x3 = f11(1, ...u); // (string | 1)[]
262+
let x3 = f11(1, ...u); // [1, ...string[]]
263263
>x3 : Symbol(x3, Decl(genericRestParameters1.ts, 66, 7))
264264
>f11 : Symbol(f11, Decl(genericRestParameters1.ts, 49, 1))
265265
>u : Symbol(u, Decl(genericRestParameters1.ts, 63, 61))

tests/baselines/reference/genericRestParameters1.types

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ function g10<U extends string[], V extends [number, number]>(u: U, v: V) {
271271
>...v : number
272272
>v : V
273273

274-
let x3 = f10(1, ...u); // (string | number)[]
275-
>x3 : (string | number)[]
276-
>f10(1, ...u) : (string | number)[]
274+
let x3 = f10(1, ...u); // [number, ...string[]]
275+
>x3 : [number, ...string[]]
276+
>f10(1, ...u) : [number, ...string[]]
277277
>f10 : <T extends unknown[]>(...args: T) => T
278278
>1 : 1
279279
>...u : string
@@ -387,9 +387,9 @@ function g11<U extends string[], V extends [number, number]>(u: U, v: V) {
387387
>...v : number
388388
>v : V
389389

390-
let x3 = f11(1, ...u); // (string | 1)[]
391-
>x3 : (string | 1)[]
392-
>f11(1, ...u) : (string | 1)[]
390+
let x3 = f11(1, ...u); // [1, ...string[]]
391+
>x3 : [1, ...string[]]
392+
>f11(1, ...u) : [1, ...string[]]
393393
>f11 : <T extends (string | number | boolean)[]>(...args: T) => T
394394
>1 : 1
395395
>...u : string

tests/baselines/reference/iterableArrayPattern14.types

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ class FooIterator {
4141
}
4242

4343
function fun(...[a, ...b]) { }
44-
>fun : (__0_0: any, __0_1?: any) => void
44+
>fun : (__0_0: any, ...__0_1: any[]) => void
4545
>a : any
4646
>b : any[]
4747

4848
fun(new FooIterator);
4949
>fun(new FooIterator) : void
50-
>fun : (__0_0: any, __0_1?: any) => void
50+
>fun : (__0_0: any, ...__0_1: any[]) => void
5151
>new FooIterator : FooIterator
5252
>FooIterator : typeof FooIterator
5353

tests/baselines/reference/optionalTupleElements1.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ tests/cases/conformance/types/tuple/optionalTupleElements1.ts(23,5): error TS232
2222
Types of property '0' are incompatible.
2323
Type 'number | undefined' is not assignable to type 'number'.
2424
Type 'undefined' is not assignable to type 'number'.
25+
tests/cases/conformance/types/tuple/optionalTupleElements1.ts(30,29): error TS1257: A required element cannot follow an optional element.
2526
tests/cases/conformance/types/tuple/optionalTupleElements1.ts(34,5): error TS2322: Type '[number, string | undefined, boolean]' is not assignable to type '[number, string, boolean]'.
2627
Type 'string | undefined' is not assignable to type 'string'.
2728
Type 'undefined' is not assignable to type 'string'.
@@ -41,7 +42,7 @@ tests/cases/conformance/types/tuple/optionalTupleElements1.ts(42,5): error TS232
4142
Type 'undefined' is not assignable to type 'number'.
4243

4344

44-
==== tests/cases/conformance/types/tuple/optionalTupleElements1.ts (11 errors) ====
45+
==== tests/cases/conformance/types/tuple/optionalTupleElements1.ts (12 errors) ====
4546
type T1 = [number, string, boolean];
4647
type T2 = [number, string, boolean?];
4748
type T3 = [number, string?, boolean?];
@@ -102,6 +103,8 @@ tests/cases/conformance/types/tuple/optionalTupleElements1.ts(42,5): error TS232
102103
}
103104

104105
type T5 = [number, string?, boolean];
106+
~~~~~~~
107+
!!! error TS1257: A required element cannot follow an optional element.
105108
type L5 = T5["length"];
106109

107110
function f2(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) {

0 commit comments

Comments
 (0)