mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
string literal case test
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user