File: quickInfoInOptionalChain.ts

package info (click to toggle)
node-typescript 5.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 497,488 kB
  • sloc: javascript: 2,107,274; makefile: 6; sh: 1
file content (28 lines) | stat: -rw-r--r-- 907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/// <reference path='fourslash.ts'/>
//
// @strict: true
//
//// interface A {
////   arr: string[];
//// }
////
//// function test(a?: A): string {
////   return a?.ar/*1*/r.length ? "A" : "B";
//// }
//// 
//// interface Foo { bar: { baz: string } };
//// declare const foo: Foo | undefined;
////
//// if (foo?.b/*2*/ar.b/*3*/az) {}
////
//// interface Foo2 { bar?: { baz: { qwe: string } } };
//// declare const foo2: Foo2;
////
//// if (foo2.b/*4*/ar?.b/*5*/az.q/*6*/we) {}

verify.quickInfoAt("1", "(property) A.arr: string[]");
verify.quickInfoAt("2", "(property) Foo.bar: {\n    baz: string;\n}");
verify.quickInfoAt("3", "(property) baz: string | undefined");
verify.quickInfoAt("4", "(property) Foo2.bar?: {\n    baz: {\n        qwe: string;\n    };\n} | undefined");
verify.quickInfoAt("5", "(property) baz: {\n    qwe: string;\n}");
verify.quickInfoAt("6", "(property) qwe: string | undefined");