From 694c714cf594f714ca87069021a94d7d8dd75cb4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 10 Nov 2015 11:56:32 -0800 Subject: [PATCH] Added test for parenthesized string literals. --- .../stringLiteralTypesAndParenthesizedExpressions01.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts diff --git a/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts new file mode 100644 index 00000000000..7910c0e16b7 --- /dev/null +++ b/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts @@ -0,0 +1,8 @@ +// @declaration: true + +declare function myRandBool(): boolean; + +let a: "foo" = ("foo"); +let b: "foo" | "bar" = ("foo"); +let c: "foo" = (myRandBool ? "foo" : ("foo")); +let d: "foo" | "bar" = (myRandBool ? "foo" : ("bar"));