Skip to content

Commit 65edb52

Browse files
committed
Adding fourslash test
1 parent 700435b commit 65edb52

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/cases/fourslash/quickInfoOnNarrowedType.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/// <reference path='fourslash.ts'/>
22

3+
// @strictNullChecks: true
4+
35
////function foo(strOrNum: string | number) {
46
//// if (typeof /*1*/strOrNum === "number") {
57
//// return /*2*/strOrNum;
@@ -9,6 +11,13 @@
911
//// }
1012
////}
1113

14+
////function bar() {
15+
//// let s: string | undefined;
16+
//// /*4*/s;
17+
//// /*5*/s = "abc";
18+
//// /*6*/s;
19+
////}
20+
1221
goTo.marker('1');
1322
verify.quickInfoIs('(parameter) strOrNum: string | number');
1423
verify.completionListContains("strOrNum", "(parameter) strOrNum: string | number");
@@ -20,3 +29,15 @@ verify.completionListContains("strOrNum", "(parameter) strOrNum: number");
2029
goTo.marker('3');
2130
verify.quickInfoIs('(parameter) strOrNum: string');
2231
verify.completionListContains("strOrNum", "(parameter) strOrNum: string");
32+
33+
goTo.marker('4');
34+
verify.quickInfoIs('let s: undefined');
35+
verify.completionListContains("s", "let s: undefined");
36+
37+
goTo.marker('5');
38+
verify.quickInfoIs('let s: string | undefined');
39+
verify.completionListContains("s", "let s: string | undefined");
40+
41+
goTo.marker('6');
42+
verify.quickInfoIs('let s: string');
43+
verify.completionListContains("s", "let s: string");

0 commit comments

Comments
 (0)