diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.js b/tests/baselines/reference/contextuallyTypeCommaOperator01.js index f8a9dbe7f8..0da3ac9100 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator01.js +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.js @@ -1,4 +1,5 @@ //// [contextuallyTypeCommaOperator01.ts] + let x: (a: string) => string; x = (100, a => a); diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols b/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols index b3b9326ea8..c07fd28ae7 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols @@ -1,10 +1,11 @@ === tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts === + let x: (a: string) => string; ->x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 0, 3)) ->a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 0, 8)) +>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 1, 3)) +>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 1, 8)) x = (100, a => a); ->x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 0, 3)) ->a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 2, 9)) ->a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 2, 9)) +>x : Symbol(x, Decl(contextuallyTypeCommaOperator01.ts, 1, 3)) +>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 3, 9)) +>a : Symbol(a, Decl(contextuallyTypeCommaOperator01.ts, 3, 9)) diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.types b/tests/baselines/reference/contextuallyTypeCommaOperator01.types index 35d5ba5af0..c3b7b700d6 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator01.types +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.types @@ -1,15 +1,16 @@ === tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts === + let x: (a: string) => string; >x : (a: string) => string >a : string x = (100, a => a); ->x = (100, a => a) : (a: any) => any +>x = (100, a => a) : (a: string) => string >x : (a: string) => string ->(100, a => a) : (a: any) => any ->100, a => a : (a: any) => any +>(100, a => a) : (a: string) => string +>100, a => a : (a: string) => string >100 : number ->a => a : (a: any) => any ->a : any ->a : any +>a => a : (a: string) => string +>a : string +>a : string diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt b/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt index e95eaedeaf..3214f7e502 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt +++ b/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt @@ -1,14 +1,18 @@ -tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(3,1): error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'. +tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(4,1): error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(5,11): error TS2322: Type 'string' is not assignable to type 'number'. -==== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts (1 errors) ==== +==== tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts (2 errors) ==== + let x: (a: string) => string; x = (100, a => { ~ -!!! error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'. +!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. const b: number = a; + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. return b; }); \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator02.js b/tests/baselines/reference/contextuallyTypeCommaOperator02.js index 1d97d7ccaa..0f8d67dd0e 100644 --- a/tests/baselines/reference/contextuallyTypeCommaOperator02.js +++ b/tests/baselines/reference/contextuallyTypeCommaOperator02.js @@ -1,4 +1,5 @@ //// [contextuallyTypeCommaOperator02.ts] + let x: (a: string) => string; x = (100, a => { diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.js b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js index 35b509f119..b8b1f0d1e0 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd01.js +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js @@ -1,4 +1,5 @@ //// [contextuallyTypeLogicalAnd01.ts] + let x: (a: string) => string; let y = true; diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols b/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols index a16ba5cc39..4d69b43e66 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols @@ -1,14 +1,15 @@ === tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts === + let x: (a: string) => string; ->x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 0, 3)) ->a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 0, 8)) +>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3)) +>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 1, 8)) let y = true; ->y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3)) +>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 2, 3)) x = y && (a => a); ->x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 0, 3)) ->y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3)) ->a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 3, 10)) ->a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 3, 10)) +>x : Symbol(x, Decl(contextuallyTypeLogicalAnd01.ts, 1, 3)) +>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 2, 3)) +>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 4, 10)) +>a : Symbol(a, Decl(contextuallyTypeLogicalAnd01.ts, 4, 10)) diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types index 92f70dcc73..a405888c8a 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types @@ -1,4 +1,5 @@ === tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts === + let x: (a: string) => string; >x : (a: string) => string >a : string @@ -8,12 +9,12 @@ let y = true; >true : boolean x = y && (a => a); ->x = y && (a => a) : (a: any) => any +>x = y && (a => a) : (a: string) => string >x : (a: string) => string ->y && (a => a) : (a: any) => any +>y && (a => a) : (a: string) => string >y : boolean ->(a => a) : (a: any) => any ->a => a : (a: any) => any ->a : any ->a : any +>(a => a) : (a: string) => string +>a => a : (a: string) => string +>a : string +>a : string diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt b/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt index 3d2cd6d065..7452d333d8 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt @@ -1,15 +1,19 @@ -tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(4,1): error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'. +tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(5,1): error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. Type 'number' is not assignable to type 'string'. +tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(6,11): error TS2322: Type 'string' is not assignable to type 'number'. -==== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts (1 errors) ==== +==== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts (2 errors) ==== + let x: (a: string) => string; let y = true; x = y && (a => { ~ -!!! error TS2322: Type '(a: any) => number' is not assignable to type '(a: string) => string'. +!!! error TS2322: Type '(a: string) => number' is not assignable to type '(a: string) => string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. const b: number = a; + ~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. return b; }); \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd02.js b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js index 11ec0aa03a..6dc1fa5b26 100644 --- a/tests/baselines/reference/contextuallyTypeLogicalAnd02.js +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js @@ -1,4 +1,5 @@ //// [contextuallyTypeLogicalAnd02.ts] + let x: (a: string) => string; let y = true;