From 4484ca062e6f8d7e05440dbafb59719ef3c7b31f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 4 Jan 2016 22:39:47 -0500 Subject: [PATCH] Accepted baselines. --- .../contextuallyTypeCommaOperator01.js | 8 ++++++++ .../contextuallyTypeCommaOperator01.symbols | 10 ++++++++++ .../contextuallyTypeCommaOperator01.types | 15 +++++++++++++++ ...contextuallyTypeCommaOperator02.errors.txt | 14 ++++++++++++++ .../contextuallyTypeCommaOperator02.js | 14 ++++++++++++++ .../reference/contextuallyTypeLogicalAnd01.js | 10 ++++++++++ .../contextuallyTypeLogicalAnd01.symbols | 14 ++++++++++++++ .../contextuallyTypeLogicalAnd01.types | 19 +++++++++++++++++++ .../contextuallyTypeLogicalAnd02.errors.txt | 15 +++++++++++++++ .../reference/contextuallyTypeLogicalAnd02.js | 16 ++++++++++++++++ 10 files changed, 135 insertions(+) create mode 100644 tests/baselines/reference/contextuallyTypeCommaOperator01.js create mode 100644 tests/baselines/reference/contextuallyTypeCommaOperator01.symbols create mode 100644 tests/baselines/reference/contextuallyTypeCommaOperator01.types create mode 100644 tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt create mode 100644 tests/baselines/reference/contextuallyTypeCommaOperator02.js create mode 100644 tests/baselines/reference/contextuallyTypeLogicalAnd01.js create mode 100644 tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols create mode 100644 tests/baselines/reference/contextuallyTypeLogicalAnd01.types create mode 100644 tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt create mode 100644 tests/baselines/reference/contextuallyTypeLogicalAnd02.js diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.js b/tests/baselines/reference/contextuallyTypeCommaOperator01.js new file mode 100644 index 0000000000..f8a9dbe7f8 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.js @@ -0,0 +1,8 @@ +//// [contextuallyTypeCommaOperator01.ts] +let x: (a: string) => string; + +x = (100, a => a); + +//// [contextuallyTypeCommaOperator01.js] +var x; +x = (100, function (a) { return a; }); diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols b/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols new file mode 100644 index 0000000000..b3b9326ea8 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.symbols @@ -0,0 +1,10 @@ +=== 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 = (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)) + diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator01.types b/tests/baselines/reference/contextuallyTypeCommaOperator01.types new file mode 100644 index 0000000000..35d5ba5af0 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator01.types @@ -0,0 +1,15 @@ +=== 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 : (a: string) => string +>(100, a => a) : (a: any) => any +>100, a => a : (a: any) => any +>100 : number +>a => a : (a: any) => any +>a : any +>a : any + diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt b/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt new file mode 100644 index 0000000000..e95eaedeaf --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator02.errors.txt @@ -0,0 +1,14 @@ +tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts(3,1): error TS2322: Type '(a: any) => 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 (1 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 'number' is not assignable to type 'string'. + const b: number = a; + return b; + }); \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeCommaOperator02.js b/tests/baselines/reference/contextuallyTypeCommaOperator02.js new file mode 100644 index 0000000000..1d97d7ccaa --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeCommaOperator02.js @@ -0,0 +1,14 @@ +//// [contextuallyTypeCommaOperator02.ts] +let x: (a: string) => string; + +x = (100, a => { + const b: number = a; + return b; +}); + +//// [contextuallyTypeCommaOperator02.js] +var x; +x = (100, function (a) { + var b = a; + return b; +}); diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.js b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js new file mode 100644 index 0000000000..35b509f119 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.js @@ -0,0 +1,10 @@ +//// [contextuallyTypeLogicalAnd01.ts] +let x: (a: string) => string; +let y = true; + +x = y && (a => a); + +//// [contextuallyTypeLogicalAnd01.js] +var x; +var y = true; +x = y && (function (a) { return a; }); diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols b/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols new file mode 100644 index 0000000000..a16ba5cc39 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.symbols @@ -0,0 +1,14 @@ +=== 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)) + +let y = true; +>y : Symbol(y, Decl(contextuallyTypeLogicalAnd01.ts, 1, 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)) + diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd01.types b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types new file mode 100644 index 0000000000..92f70dcc73 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd01.types @@ -0,0 +1,19 @@ +=== tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts === +let x: (a: string) => string; +>x : (a: string) => string +>a : string + +let y = true; +>y : boolean +>true : boolean + +x = y && (a => a); +>x = y && (a => a) : (a: any) => any +>x : (a: string) => string +>y && (a => a) : (a: any) => any +>y : boolean +>(a => a) : (a: any) => any +>a => a : (a: any) => any +>a : any +>a : any + diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt b/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt new file mode 100644 index 0000000000..3d2cd6d065 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd02.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts(4,1): error TS2322: Type '(a: any) => 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 (1 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 'number' is not assignable to type 'string'. + const b: number = a; + return b; + }); \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypeLogicalAnd02.js b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js new file mode 100644 index 0000000000..11ec0aa03a --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeLogicalAnd02.js @@ -0,0 +1,16 @@ +//// [contextuallyTypeLogicalAnd02.ts] +let x: (a: string) => string; +let y = true; + +x = y && (a => { + const b: number = a; + return b; +}); + +//// [contextuallyTypeLogicalAnd02.js] +var x; +var y = true; +x = y && (function (a) { + var b = a; + return b; +});