Accept new baselines

This commit is contained in:
Anders Hejlsberg 2018-06-24 14:33:11 -10:00
parent 9cd8eadfd2
commit 3cc3b49030
8 changed files with 27 additions and 17 deletions

View File

@ -1479,6 +1479,7 @@ declare namespace ts {
}
interface SyntheticExpression extends Expression {
kind: SyntaxKind.SyntheticExpression;
isSpread: boolean;
type: Type;
}
type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;
@ -5048,6 +5049,8 @@ declare namespace ts {
_0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag: DiagnosticMessage;
A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal: DiagnosticMessage;
A_definite_assignment_assertion_is_not_permitted_in_this_context: DiagnosticMessage;
A_rest_element_must_be_last_in_a_tuple_type: DiagnosticMessage;
A_required_element_cannot_follow_an_optional_element: DiagnosticMessage;
with_statements_are_not_allowed_in_an_async_function_block: DiagnosticMessage;
await_expression_is_only_allowed_within_an_async_function: DiagnosticMessage;
can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment: DiagnosticMessage;
@ -5344,6 +5347,9 @@ declare namespace ts {
Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: DiagnosticMessage;
Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await: DiagnosticMessage;
Object_is_of_type_unknown: DiagnosticMessage;
Rest_signatures_are_incompatible: DiagnosticMessage;
Property_0_is_incompatible_with_rest_element_type: DiagnosticMessage;
A_rest_element_type_must_be_an_array_type: DiagnosticMessage;
JSX_element_attributes_type_0_may_not_be_a_union_type: DiagnosticMessage;
The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: DiagnosticMessage;
JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: DiagnosticMessage;

View File

@ -888,6 +888,7 @@ declare namespace ts {
}
interface SyntheticExpression extends Expression {
kind: SyntaxKind.SyntheticExpression;
isSpread: boolean;
type: Type;
}
type ExponentiationOperator = SyntaxKind.AsteriskAsteriskToken;

View File

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

View File

@ -46,7 +46,7 @@ const x18 = f10(...ns, true); // (string | number | boolean)[]
function g10<U extends string[], V extends [number, number]>(u: U, v: V) {
let x1 = f10(...u); // U
let x2 = f10(...v); // V
let x3 = f10(1, ...u); // (string | number)[]
let x3 = f10(1, ...u); // [number, ...string[]]
let x4 = f10(...u, ...v); // (string | number)[]
}
@ -65,7 +65,7 @@ const z18 = f11(...ns, true); // (string | number | true)[]
function g11<U extends string[], V extends [number, number]>(u: U, v: V) {
let x1 = f11(...u); // U
let x2 = f11(...v); // V
let x3 = f11(1, ...u); // (string | 1)[]
let x3 = f11(1, ...u); // [1, ...string[]]
let x4 = f11(...u, ...v); // (string | number)[]
}
@ -187,7 +187,7 @@ var x18 = f10.apply(void 0, ns.concat([true])); // (string | number | boolean)[]
function g10(u, v) {
var x1 = f10.apply(void 0, u); // U
var x2 = f10.apply(void 0, v); // V
var x3 = f10.apply(void 0, [1].concat(u)); // (string | number)[]
var x3 = f10.apply(void 0, [1].concat(u)); // [number, ...string[]]
var x4 = f10.apply(void 0, u.concat(v)); // (string | number)[]
}
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)[]
function g11(u, v) {
var x1 = f11.apply(void 0, u); // U
var x2 = f11.apply(void 0, v); // V
var x3 = f11.apply(void 0, [1].concat(u)); // (string | 1)[]
var x3 = f11.apply(void 0, [1].concat(u)); // [1, ...string[]]
var x4 = f11.apply(void 0, u.concat(v)); // (string | number)[]
}
function call(f) {

View File

@ -180,7 +180,7 @@ function g10<U extends string[], V extends [number, number]>(u: U, v: V) {
>f10 : Symbol(f10, Decl(genericRestParameters1.ts, 30, 16))
>v : Symbol(v, Decl(genericRestParameters1.ts, 44, 66))
let x3 = f10(1, ...u); // (string | number)[]
let x3 = f10(1, ...u); // [number, ...string[]]
>x3 : Symbol(x3, Decl(genericRestParameters1.ts, 47, 7))
>f10 : Symbol(f10, Decl(genericRestParameters1.ts, 30, 16))
>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) {
>f11 : Symbol(f11, Decl(genericRestParameters1.ts, 49, 1))
>v : Symbol(v, Decl(genericRestParameters1.ts, 63, 66))
let x3 = f11(1, ...u); // (string | 1)[]
let x3 = f11(1, ...u); // [1, ...string[]]
>x3 : Symbol(x3, Decl(genericRestParameters1.ts, 66, 7))
>f11 : Symbol(f11, Decl(genericRestParameters1.ts, 49, 1))
>u : Symbol(u, Decl(genericRestParameters1.ts, 63, 61))

View File

@ -271,9 +271,9 @@ function g10<U extends string[], V extends [number, number]>(u: U, v: V) {
>...v : number
>v : V
let x3 = f10(1, ...u); // (string | number)[]
>x3 : (string | number)[]
>f10(1, ...u) : (string | number)[]
let x3 = f10(1, ...u); // [number, ...string[]]
>x3 : [number, ...string[]]
>f10(1, ...u) : [number, ...string[]]
>f10 : <T extends unknown[]>(...args: T) => T
>1 : 1
>...u : string
@ -387,9 +387,9 @@ function g11<U extends string[], V extends [number, number]>(u: U, v: V) {
>...v : number
>v : V
let x3 = f11(1, ...u); // (string | 1)[]
>x3 : (string | 1)[]
>f11(1, ...u) : (string | 1)[]
let x3 = f11(1, ...u); // [1, ...string[]]
>x3 : [1, ...string[]]
>f11(1, ...u) : [1, ...string[]]
>f11 : <T extends (string | number | boolean)[]>(...args: T) => T
>1 : 1
>...u : string

View File

@ -41,13 +41,13 @@ class FooIterator {
}
function fun(...[a, ...b]) { }
>fun : (__0_0: any, __0_1?: any) => void
>fun : (__0_0: any, ...__0_1: any[]) => void
>a : any
>b : any[]
fun(new FooIterator);
>fun(new FooIterator) : void
>fun : (__0_0: any, __0_1?: any) => void
>fun : (__0_0: any, ...__0_1: any[]) => void
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator

View File

@ -22,6 +22,7 @@ tests/cases/conformance/types/tuple/optionalTupleElements1.ts(23,5): error TS232
Types of property '0' are incompatible.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
tests/cases/conformance/types/tuple/optionalTupleElements1.ts(30,29): error TS1257: A required element cannot follow an optional element.
tests/cases/conformance/types/tuple/optionalTupleElements1.ts(34,5): error TS2322: Type '[number, string | undefined, boolean]' is not assignable to type '[number, string, boolean]'.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
@ -41,7 +42,7 @@ tests/cases/conformance/types/tuple/optionalTupleElements1.ts(42,5): error TS232
Type 'undefined' is not assignable to type 'number'.
==== tests/cases/conformance/types/tuple/optionalTupleElements1.ts (11 errors) ====
==== tests/cases/conformance/types/tuple/optionalTupleElements1.ts (12 errors) ====
type T1 = [number, string, boolean];
type T2 = [number, string, boolean?];
type T3 = [number, string?, boolean?];
@ -102,6 +103,8 @@ tests/cases/conformance/types/tuple/optionalTupleElements1.ts(42,5): error TS232
}
type T5 = [number, string?, boolean];
~~~~~~~
!!! error TS1257: A required element cannot follow an optional element.
type L5 = T5["length"];
function f2(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) {