string literal case test

This commit is contained in:
Wesley Wigham committed 2016-04-26 03:13:08 -04:00
1 parent 20d8a94d66
commit a2feb0ee7d
4 files changed
+98

No files matched your search

@@ -0,0 +1,10 @@
declare function isFoo(value: string) : value is "foo";
declare function doThis(value: "foo"): void;
declare function doThat(value: string) : void;
let value: string;
if (isFoo(value)) {
doThis(value);
} else {
doThat(value);
}