From 98de6117f1cab5861bece38ece96b7e3b56abb5a Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Thu, 2 Jul 2015 15:21:09 -0700 Subject: [PATCH] Accept baselines --- ...ndAdditionAssignmentLHSCanBeAssigned.types | 2 +- ...ualTypeWithUnionTypeCallSignatures.symbols | 2 ++ ...xtualTypeWithUnionTypeCallSignatures.types | 12 ++++---- .../functionConstraintSatisfaction3.types | 28 +++++++++---------- .../genericCallWithTupleType.errors.txt | 8 +++--- .../reference/noErrorsInCallback.errors.txt | 8 +++--- .../typeParameterFixingWithConstraints.types | 10 +++---- ...wrappedAndRecursiveConstraints4.errors.txt | 4 +-- 8 files changed, 38 insertions(+), 36 deletions(-) diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types index e40422450b4..92835611c6d 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCanBeAssigned.types @@ -98,7 +98,7 @@ x2 += E.a; x2 += {}; >x2 += {} : string >x2 : string ->{} : {} +>{} : { [x: number]: undefined; } x2 += null; >x2 += null : string diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols index 172336603ab..3e23a7812f5 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.symbols @@ -82,5 +82,7 @@ var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any >IWithCallSignatures : Symbol(IWithCallSignatures, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 9, 1)) >IWithCallSignatures4 : Symbol(IWithCallSignatures4, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 18, 1)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52)) +>a.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeCallSignatures.ts, 35, 52)) +>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18)) diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types index 02dfecf5c08..8e1915d4754 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeCallSignatures.types @@ -90,10 +90,10 @@ var x4: IWithCallSignatures | IWithCallSignatures4 = a => /*here a should be any >x4 : IWithCallSignatures | IWithCallSignatures4 >IWithCallSignatures : IWithCallSignatures >IWithCallSignatures4 : IWithCallSignatures4 ->a => /*here a should be any*/ a.toString() : (a: any) => any ->a : any ->a.toString() : any ->a.toString : any ->a : any ->toString : any +>a => /*here a should be any*/ a.toString() : (a: number) => string +>a : number +>a.toString() : string +>a.toString : (radix?: number) => string +>a : number +>toString : (radix?: number) => string diff --git a/tests/baselines/reference/functionConstraintSatisfaction3.types b/tests/baselines/reference/functionConstraintSatisfaction3.types index 04963c36519..c58e62f6995 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction3.types +++ b/tests/baselines/reference/functionConstraintSatisfaction3.types @@ -37,12 +37,12 @@ var c: { (): string; (x): string }; >x : any var r1 = foo((x) => x); ->r1 : (x: any) => any ->foo((x) => x) : (x: any) => any +>r1 : (x: string) => string +>foo((x) => x) : (x: string) => string >foo : string>(x: T) => T ->(x) => x : (x: any) => any ->x : any ->x : any +>(x) => x : (x: string) => string +>x : string +>x : string var r2 = foo((x: string) => x); >r2 : (x: string) => string @@ -53,12 +53,12 @@ var r2 = foo((x: string) => x); >x : string var r3 = foo(function (x) { return x }); ->r3 : (x: any) => any ->foo(function (x) { return x }) : (x: any) => any +>r3 : (x: string) => string +>foo(function (x) { return x }) : (x: string) => string >foo : string>(x: T) => T ->function (x) { return x } : (x: any) => any ->x : any ->x : any +>function (x) { return x } : (x: string) => string +>x : string +>x : string var r4 = foo(function (x: string) { return x }); >r4 : (x: string) => string @@ -130,8 +130,8 @@ var c2: { (x: T): T; (x: T, y: T): T }; >T : T var r9 = foo(function (x: U) { return x; }); ->r9 : (x: U) => U ->foo(function (x: U) { return x; }) : (x: U) => U +>r9 : (x: string) => string +>foo(function (x: U) { return x; }) : (x: string) => string >foo : string>(x: T) => T >function (x: U) { return x; } : (x: U) => U >U : U @@ -140,8 +140,8 @@ var r9 = foo(function (x: U) { return x; }); >x : U var r10 = foo((x: U) => x); ->r10 : (x: U) => U ->foo((x: U) => x) : (x: U) => U +>r10 : (x: string) => string +>foo((x: U) => x) : (x: string) => string >foo : string>(x: T) => T >(x: U) => x : (x: U) => U >U : U diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index bcf580320e5..d03f8d5e68a 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -9,9 +9,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,1): error TS2322: Type '[number, string]' is not assignable to type '[string, number]'. Types of property '0' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(23,1): error TS2322: Type '[{ [x: number]: undefined; }, {}]' is not assignable to type '[string, number]'. Types of property '0' are incompatible. - Type '{}' is not assignable to type 'string'. + Type '{ [x: number]: undefined; }' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(24,1): error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. Property '1' is missing in type '[{}]'. @@ -55,9 +55,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup !!! error TS2322: Type 'number' is not assignable to type 'string'. i1.tuple1 = [{}, {}]; ~~~~~~~~~ -!!! error TS2322: Type '[{}, {}]' is not assignable to type '[string, number]'. +!!! error TS2322: Type '[{ [x: number]: undefined; }, {}]' is not assignable to type '[string, number]'. !!! error TS2322: Types of property '0' are incompatible. -!!! error TS2322: Type '{}' is not assignable to type 'string'. +!!! error TS2322: Type '{ [x: number]: undefined; }' is not assignable to type 'string'. i2.tuple1 = [{}]; ~~~~~~~~~ !!! error TS2322: Type '[{}]' is not assignable to type '[{}, {}]'. diff --git a/tests/baselines/reference/noErrorsInCallback.errors.txt b/tests/baselines/reference/noErrorsInCallback.errors.txt index f0bfe00199e..90fdbbd77a5 100644 --- a/tests/baselines/reference/noErrorsInCallback.errors.txt +++ b/tests/baselines/reference/noErrorsInCallback.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/noErrorsInCallback.ts(4,19): error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. -tests/cases/compiler/noErrorsInCallback.ts(6,23): error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. +tests/cases/compiler/noErrorsInCallback.ts(4,19): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'string'. +tests/cases/compiler/noErrorsInCallback.ts(6,23): error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'string'. ==== tests/cases/compiler/noErrorsInCallback.ts (2 errors) ==== @@ -8,10 +8,10 @@ tests/cases/compiler/noErrorsInCallback.ts(6,23): error TS2345: Argument of type } var one = new Bar({}); // Error ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'string'. [].forEach(() => { var two = new Bar({}); // No error? ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'string'. +!!! error TS2345: Argument of type '{ [x: number]: undefined; }' is not assignable to parameter of type 'string'. }); \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterFixingWithConstraints.types b/tests/baselines/reference/typeParameterFixingWithConstraints.types index 64876952852..22d294f9d2e 100644 --- a/tests/baselines/reference/typeParameterFixingWithConstraints.types +++ b/tests/baselines/reference/typeParameterFixingWithConstraints.types @@ -31,17 +31,17 @@ var foo: IFoo; >IFoo : IFoo foo.foo({ bar: null }, bar => null, bar => null); ->foo.foo({ bar: null }, bar => null, bar => null) : IBar +>foo.foo({ bar: null }, bar => null, bar => null) : { [x: string]: any; bar: any; } >foo.foo : (bar: TBar, bar1: (bar: TBar) => TBar, bar2: (bar: TBar) => TBar) => TBar >foo : IFoo >foo : (bar: TBar, bar1: (bar: TBar) => TBar, bar2: (bar: TBar) => TBar) => TBar >{ bar: null } : { [x: string]: null; bar: null; } >bar : null >null : null ->bar => null : (bar: IBar) => any ->bar : IBar +>bar => null : (bar: { [x: string]: any; bar: any; }) => any +>bar : { [x: string]: any; bar: any; } >null : null ->bar => null : (bar: IBar) => any ->bar : IBar +>bar => null : (bar: { [x: string]: any; bar: any; }) => any +>bar : { [x: string]: any; bar: any; } >null : null diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt index 47e8e6ff4f2..60602351b46 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints4.ts(13,12): error TS2345: Argument of type '{ length: number; charAt: (x: number) => void; }' is not assignable to parameter of type 'string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints4.ts(13,12): error TS2345: Argument of type '{ [x: number]: undefined; length: number; charAt: (x: number) => void; }' is not assignable to parameter of type 'string'. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints4.ts (1 errors) ==== @@ -16,4 +16,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursi var r = c.foo(''); var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ length: number; charAt: (x: number) => void; }' is not assignable to parameter of type 'string'. \ No newline at end of file +!!! error TS2345: Argument of type '{ [x: number]: undefined; length: number; charAt: (x: number) => void; }' is not assignable to parameter of type 'string'. \ No newline at end of file