From 24a108936f4941156147f3283f996f9e2fed972d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 4 Jan 2016 22:27:57 -0500 Subject: [PATCH] Added tests. --- .../commaOperator/contextuallyTypeCommaOperator01.ts | 3 +++ .../commaOperator/contextuallyTypeCommaOperator02.ts | 6 ++++++ .../logicalAnd/contextuallyTypeLogicalAnd01.ts | 4 ++++ .../logicalAnd/contextuallyTypeLogicalAnd02.ts | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts create mode 100644 tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts create mode 100644 tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts create mode 100644 tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts new file mode 100644 index 0000000000..f5d8326611 --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts @@ -0,0 +1,3 @@ +let x: (a: string) => string; + +x = (100, a => a); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts new file mode 100644 index 0000000000..bd38c61677 --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts @@ -0,0 +1,6 @@ +let x: (a: string) => string; + +x = (100, a => { + const b: number = a; + return b; +}); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts new file mode 100644 index 0000000000..2cc3d8fde2 --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts @@ -0,0 +1,4 @@ +let x: (a: string) => string; +let y = true; + +x = y && (a => a); \ No newline at end of file diff --git a/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts new file mode 100644 index 0000000000..fbd196e7b6 --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd02.ts @@ -0,0 +1,7 @@ +let x: (a: string) => string; +let y = true; + +x = y && (a => { + const b: number = a; + return b; +}); \ No newline at end of file