Accepting new baselines

This commit is contained in:
Anders Hejlsberg 2015-09-01 13:17:02 -07:00
parent f28e424d31
commit 66e3abaa12
15 changed files with 24 additions and 36 deletions

View file

@ -100,12 +100,12 @@ var p8 = ({ a = 1 }) => { };
>1 : number
var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
>p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void
>p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void
>a : any
>b : number
>1 : number
>{ b: 1 } : { b: number; }
>{ b: 1 } : { b?: number; }
>b : number
>1 : number

View file

@ -21,8 +21,8 @@ function h1(_a) {
//// [declarationEmitDestructuring2.d.ts]
declare function f({x, y: [a, b, c, d]}?: {
x: number;
y: [number, number, number, number];
x?: number;
y?: [number, number, number, number];
}): void;
declare function g([a, b, c, d]?: [number, number, number, number]): void;
declare function h([a, [b], [[c]], {x, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], {

View file

@ -23,7 +23,7 @@ var [a11, b11, c11] = [];
>a11 : any
>b11 : any
>c11 : any
>[] : undefined[]
>[] : [any, any, any]
var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]];
>a2 : number

View file

@ -1,7 +1,5 @@
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(5,16): error TS2493: Tuple type '[number, string]' with length '2' cannot be assigned to tuple with length '3'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(6,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'any', but here has type 'number'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,13): error TS2493: Tuple type '[number]' with length '1' cannot be assigned to tuple with length '3'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,16): error TS2493: Tuple type '[number]' with length '1' cannot be assigned to tuple with length '3'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(67,9): error TS2461: Type '{ [x: number]: undefined; }' is not an array type.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(68,9): error TS2461: Type '{ [x: number]: number; 0: number; 1: number; }' is not an array type.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,11): error TS2459: Type '{}' has no property 'a' and no string index signature.
@ -18,15 +16,15 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,6):
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): error TS2322: Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts (13 errors) ====
==== tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts (11 errors) ====
function f0() {
var [] = [1, "hello"];
var [x] = [1, "hello"];
var [x, y] = [1, "hello"];
var [x, y, z] = [1, "hello"]; // Error
~
!!! error TS2493: Tuple type '[number, string]' with length '2' cannot be assigned to tuple with length '3'.
var [,, z] = [0, 1, 2];
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'any', but here has type 'number'.
var x: number;
var y: string;
}
@ -86,10 +84,6 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9):
function f8() {
var [a, b, c] = []; // Ok, [] is an array
var [d, e, f] = [1]; // Error, [1] is a tuple
~
!!! error TS2493: Tuple type '[number]' with length '1' cannot be assigned to tuple with length '3'.
~
!!! error TS2493: Tuple type '[number]' with length '1' cannot be assigned to tuple with length '3'.
}
function f9() {

View file

@ -93,7 +93,7 @@ var [c0, c1] = [...temp];
var [c2] = [];
>c2 : any
>[] : undefined[]
>[] : [any]
var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]]
>c3 : any

View file

@ -94,7 +94,7 @@ var [c0, c1] = [...temp];
var [c2] = [];
>c2 : any
>[] : undefined[]
>[] : [any]
var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]]
>c3 : any

View file

@ -1,5 +1,3 @@
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2461: Type 'undefined' is not an array type.
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2461: Type 'undefined' is not an array type.
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type.
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, number, string]' is not assignable to type '[number, boolean, string]'.
Types of property '1' are incompatible.
@ -13,14 +11,10 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(34,5): error TS2461: Type 'F' is not an array type.
==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts (8 errors) ====
==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts (6 errors) ====
// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V,
// S is the type Any, or
var [[a0], [[a1]]] = [] // Error
~~~~
!!! error TS2461: Type 'undefined' is not an array type.
~~~~~~
!!! error TS2461: Type 'undefined' is not an array type.
var [[a2], [[a3]]] = undefined // Error
~~~~~~~~~~~~~~
!!! error TS2461: Type 'undefined' is not an array type.

View file

@ -27,7 +27,7 @@ var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } };
>{ b21: "string" } : { b21: string; }
>b21 : string
>"string" : string
>{ b2: { b21: "world" } } : { b2: { b21: string; }; }
>{ b2: { b21: "world" } } : { b2?: { b21: string; }; }
>b2 : { b21: string; }
>{ b21: "world" } : { b21: string; }
>b21 : string

View file

@ -27,7 +27,7 @@ var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } };
>{ b21: "string" } : { b21: string; }
>b21 : string
>"string" : string
>{ b2: { b21: "world" } } : { b2: { b21: string; }; }
>{ b2: { b21: "world" } } : { b2?: { b21: string; }; }
>b2 : { b21: string; }
>{ b21: "world" } : { b21: string; }
>b21 : string

View file

@ -31,7 +31,7 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } };
>{ b11: "string" } : { b11: string; }
>b11 : string
>"string" : string
>{ b1: { b11: "world" } } : { b1: { b11: string; }; }
>{ b1: { b11: "world" } } : { b1?: { b11: string; }; }
>b1 : { b11: string; }
>{ b11: "world" } : { b11: string; }
>b11 : string

View file

@ -31,7 +31,7 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } };
>{ b11: "string" } : { b11: string; }
>b11 : string
>"string" : string
>{ b1: { b11: "world" } } : { b1: { b11: string; }; }
>{ b1: { b11: "world" } } : { b1?: { b11: string; }; }
>b1 : { b11: string; }
>{ b11: "world" } : { b11: string; }
>b11 : string

View file

@ -13,7 +13,7 @@ const bar = 1;
let [baz] = [];
>baz : any
>[] : undefined[]
>[] : [any]
let {a: baz2} = { a: 1 };
>a : any
@ -24,7 +24,7 @@ let {a: baz2} = { a: 1 };
const [baz3] = []
>baz3 : any
>[] : undefined[]
>[] : [any]
const {a: baz4} = { a: 1 };
>a : any

View file

@ -87,12 +87,12 @@ var p8 = ({ a = 1 }) => { };
>1 : number
var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
>p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void
>p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b?: number; }; }) => void
>a : any
>b : number
>1 : number
>{ b: 1 } : { b: number; }
>{ b: 1 } : { b?: number; }
>b : number
>1 : number

View file

@ -5,7 +5,7 @@ var c = {};
[...c] = ["", 0];
>[...c] = ["", 0] : (string | number)[]
>[...c] : {}[]
>[...c] : undefined[]
>...c : any
>c : {}
>["", 0] : (string | number)[]

View file

@ -5,7 +5,7 @@ var c = {};
[...c] = ["", 0];
>[...c] = ["", 0] : (string | number)[]
>[...c] : {}[]
>[...c] : undefined[]
>...c : any
>c : {}
>["", 0] : (string | number)[]