Accept baselines

This commit is contained in:
Jason Freeman 2015-07-14 11:50:00 -07:00
parent 6954cd2fd7
commit 6f94314774
19 changed files with 231 additions and 19 deletions

View file

@ -1,16 +1,8 @@
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(32,4): error TS2345: Argument of type '[string, number, number]' is not assignable to parameter of type '[undefined, null, undefined]'.
Types of property '0' are incompatible.
Type 'string' is not assignable to type 'undefined'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(33,4): error TS2345: Argument of type '[[string], number, [[boolean, boolean]]]' is not assignable to parameter of type '[[undefined], undefined, [[undefined, undefined]]]'.
Types of property '0' are incompatible.
Type '[string]' is not assignable to type '[undefined]'.
Types of property '0' are incompatible.
Type 'string' is not assignable to type 'undefined'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(62,10): error TS2393: Duplicate function implementation.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(63,10): error TS2393: Duplicate function implementation.
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts (4 errors) ====
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts (2 errors) ====
// A parameter declaration may specify either an identifier or a binding pattern.
// The identifiers specified in parameter declarations and binding patterns
// in a parameter list must be unique within that parameter list.
@ -43,17 +35,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.
b2("string", { x: 200, y: "string" });
b2("string", { x: 200, y: true });
b6(["string", 1, 2]); // Shouldn't be an error
~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '[string, number, number]' is not assignable to parameter of type '[undefined, null, undefined]'.
!!! error TS2345: Types of property '0' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'undefined'.
b7([["string"], 1, [[true, false]]]); // Shouldn't be an error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '[[string], number, [[boolean, boolean]]]' is not assignable to parameter of type '[[undefined], undefined, [[undefined, undefined]]]'.
!!! error TS2345: Types of property '0' are incompatible.
!!! error TS2345: Type '[string]' is not assignable to type '[undefined]'.
!!! error TS2345: Types of property '0' are incompatible.
!!! error TS2345: Type 'string' is not assignable to type 'undefined'.
// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3)

View file

@ -0,0 +1,9 @@
//// [wideningTuples1.ts]
declare function foo<T extends [any]>(x: T): T;
var y = foo([undefined]);
y = [""];
//// [wideningTuples1.js]
var y = foo([undefined]);
y = [""];

View file

@ -0,0 +1,16 @@
=== tests/cases/conformance/types/tuple/wideningTuples1.ts ===
declare function foo<T extends [any]>(x: T): T;
>foo : Symbol(foo, Decl(wideningTuples1.ts, 0, 0))
>T : Symbol(T, Decl(wideningTuples1.ts, 0, 21))
>x : Symbol(x, Decl(wideningTuples1.ts, 0, 38))
>T : Symbol(T, Decl(wideningTuples1.ts, 0, 21))
>T : Symbol(T, Decl(wideningTuples1.ts, 0, 21))
var y = foo([undefined]);
>y : Symbol(y, Decl(wideningTuples1.ts, 2, 3))
>foo : Symbol(foo, Decl(wideningTuples1.ts, 0, 0))
>undefined : Symbol(undefined)
y = [""];
>y : Symbol(y, Decl(wideningTuples1.ts, 2, 3))

View file

@ -0,0 +1,21 @@
=== tests/cases/conformance/types/tuple/wideningTuples1.ts ===
declare function foo<T extends [any]>(x: T): T;
>foo : <T extends [any]>(x: T) => T
>T : T
>x : T
>T : T
>T : T
var y = foo([undefined]);
>y : [any]
>foo([undefined]) : [any]
>foo : <T extends [any]>(x: T) => T
>[undefined] : [undefined]
>undefined : undefined
y = [""];
>y = [""] : [string]
>y : [any]
>[""] : [string]
>"" : string

View file

@ -0,0 +1,13 @@
//// [wideningTuples2.ts]
var foo: () => [any] = function bar() {
let intermediate = bar();
intermediate = [""];
return [undefined];
};
//// [wideningTuples2.js]
var foo = function bar() {
var intermediate = bar();
intermediate = [""];
return [undefined];
};

View file

@ -0,0 +1,16 @@
=== tests/cases/conformance/types/tuple/wideningTuples2.ts ===
var foo: () => [any] = function bar() {
>foo : Symbol(foo, Decl(wideningTuples2.ts, 0, 3))
>bar : Symbol(bar, Decl(wideningTuples2.ts, 0, 22))
let intermediate = bar();
>intermediate : Symbol(intermediate, Decl(wideningTuples2.ts, 1, 7))
>bar : Symbol(bar, Decl(wideningTuples2.ts, 0, 22))
intermediate = [""];
>intermediate : Symbol(intermediate, Decl(wideningTuples2.ts, 1, 7))
return [undefined];
>undefined : Symbol(undefined)
};

View file

@ -0,0 +1,22 @@
=== tests/cases/conformance/types/tuple/wideningTuples2.ts ===
var foo: () => [any] = function bar() {
>foo : () => [any]
>function bar() { let intermediate = bar(); intermediate = [""]; return [undefined];} : () => [any]
>bar : () => [any]
let intermediate = bar();
>intermediate : [any]
>bar() : [any]
>bar : () => [any]
intermediate = [""];
>intermediate = [""] : [string]
>intermediate : [any]
>[""] : [string]
>"" : string
return [undefined];
>[undefined] : [undefined]
>undefined : undefined
};

View file

@ -0,0 +1,9 @@
tests/cases/conformance/types/tuple/wideningTuples3.ts(3,5): error TS7005: Variable 'b' implicitly has an '[any, any]' type.
==== tests/cases/conformance/types/tuple/wideningTuples3.ts (1 errors) ====
var a: [any];
var b = a = [undefined, null];
~
!!! error TS7005: Variable 'b' implicitly has an '[any, any]' type.

View file

@ -0,0 +1,8 @@
//// [wideningTuples3.ts]
var a: [any];
var b = a = [undefined, null];
//// [wideningTuples3.js]
var a;
var b = a = [undefined, null];

View file

@ -0,0 +1,10 @@
//// [wideningTuples4.ts]
var a: [any];
var b = a = [undefined, null];
b = ["", ""];
//// [wideningTuples4.js]
var a;
var b = a = [undefined, null];
b = ["", ""];

View file

@ -0,0 +1,12 @@
=== tests/cases/conformance/types/tuple/wideningTuples4.ts ===
var a: [any];
>a : Symbol(a, Decl(wideningTuples4.ts, 0, 3))
var b = a = [undefined, null];
>b : Symbol(b, Decl(wideningTuples4.ts, 2, 3))
>a : Symbol(a, Decl(wideningTuples4.ts, 0, 3))
>undefined : Symbol(undefined)
b = ["", ""];
>b : Symbol(b, Decl(wideningTuples4.ts, 2, 3))

View file

@ -0,0 +1,19 @@
=== tests/cases/conformance/types/tuple/wideningTuples4.ts ===
var a: [any];
>a : [any]
var b = a = [undefined, null];
>b : [any, any]
>a = [undefined, null] : [undefined, null]
>a : [any]
>[undefined, null] : [undefined, null]
>undefined : undefined
>null : null
b = ["", ""];
>b = ["", ""] : [string, string]
>b : [any, any]
>["", ""] : [string, string]
>"" : string
>"" : string

View file

@ -0,0 +1,10 @@
tests/cases/conformance/types/tuple/wideningTuples5.ts(1,6): error TS7005: Variable 'a' implicitly has an 'any' type.
tests/cases/conformance/types/tuple/wideningTuples5.ts(1,9): error TS7005: Variable 'b' implicitly has an 'any' type.
==== tests/cases/conformance/types/tuple/wideningTuples5.ts (2 errors) ====
var [a, b] = [undefined, null];
~
!!! error TS7005: Variable 'a' implicitly has an 'any' type.
~
!!! error TS7005: Variable 'b' implicitly has an 'any' type.

View file

@ -0,0 +1,5 @@
//// [wideningTuples5.ts]
var [a, b] = [undefined, null];
//// [wideningTuples5.js]
var _a = [undefined, null], a = _a[0], b = _a[1];

View file

@ -0,0 +1,9 @@
//// [wideningTuples6.ts]
var [a, b] = [undefined, null];
a = "";
b = "";
//// [wideningTuples6.js]
var _a = [undefined, null], a = _a[0], b = _a[1];
a = "";
b = "";

View file

@ -0,0 +1,12 @@
=== tests/cases/conformance/types/tuple/wideningTuples6.ts ===
var [a, b] = [undefined, null];
>a : Symbol(a, Decl(wideningTuples6.ts, 0, 5))
>b : Symbol(b, Decl(wideningTuples6.ts, 0, 7))
>undefined : Symbol(undefined)
a = "";
>a : Symbol(a, Decl(wideningTuples6.ts, 0, 5))
b = "";
>b : Symbol(b, Decl(wideningTuples6.ts, 0, 7))

View file

@ -0,0 +1,18 @@
=== tests/cases/conformance/types/tuple/wideningTuples6.ts ===
var [a, b] = [undefined, null];
>a : any
>b : any
>[undefined, null] : [undefined, null]
>undefined : undefined
>null : null
a = "";
>a = "" : string
>a : any
>"" : string
b = "";
>b = "" : string
>b : any
>"" : string

View file

@ -0,0 +1,10 @@
tests/cases/conformance/types/tuple/wideningTuples7.ts(1,20): error TS7010: 'bar', which lacks return-type annotation, implicitly has an '[any]' return type.
==== tests/cases/conformance/types/tuple/wideningTuples7.ts (1 errors) ====
var foo = function bar() {
~~~
!!! error TS7010: 'bar', which lacks return-type annotation, implicitly has an '[any]' return type.
let intermediate: [string];
return intermediate = [undefined];
};

View file

@ -0,0 +1,11 @@
//// [wideningTuples7.ts]
var foo = function bar() {
let intermediate: [string];
return intermediate = [undefined];
};
//// [wideningTuples7.js]
var foo = function bar() {
var intermediate;
return intermediate = [undefined];
};