TypeScript/tests/baselines/reference/callChain.2.symbols
Ron Buckton fcd9334f57
Add support for Optional Chaining (#33294)
* Add support for Optional Chaining

* Add grammar error for invalid tagged template, more tests

* Prototype

* PR feedback

* Add errors for invalid assignments and a trailing '?.'

* Add additional signature help test, fix lint warnings

* Fix to insert text for completions

* Add initial control-flow analysis for optional chains

* PR Feedback and more tests

* Update to control flow

* Remove mangled smart quotes in comments

* Fix lint, PR feedback

* Updates to control flow

* Switch to FlowCondition for CFA of optional chains

* Fix ?. insertion for completions on type variables

* Accept API baseline change

* Clean up types

* improve control-flow debug output

* Revert Debug.formatControlFlowGraph helper
2019-09-30 12:33:28 -07:00

28 lines
994 B
Text

=== tests/cases/conformance/expressions/optionalChaining/callChain/callChain.2.ts ===
declare const o1: undefined | (() => number);
>o1 : Symbol(o1, Decl(callChain.2.ts, 0, 13))
o1?.();
>o1 : Symbol(o1, Decl(callChain.2.ts, 0, 13))
declare const o2: undefined | { b: () => number };
>o2 : Symbol(o2, Decl(callChain.2.ts, 3, 13))
>b : Symbol(b, Decl(callChain.2.ts, 3, 31))
o2?.b();
>o2?.b : Symbol(b, Decl(callChain.2.ts, 3, 31))
>o2 : Symbol(o2, Decl(callChain.2.ts, 3, 13))
>b : Symbol(b, Decl(callChain.2.ts, 3, 31))
declare const o3: { b: (() => { c: string }) | undefined };
>o3 : Symbol(o3, Decl(callChain.2.ts, 6, 13))
>b : Symbol(b, Decl(callChain.2.ts, 6, 19))
>c : Symbol(c, Decl(callChain.2.ts, 6, 31))
o3.b?.().c;
>o3.b?.().c : Symbol(c, Decl(callChain.2.ts, 6, 31))
>o3.b : Symbol(b, Decl(callChain.2.ts, 6, 19))
>o3 : Symbol(o3, Decl(callChain.2.ts, 6, 13))
>b : Symbol(b, Decl(callChain.2.ts, 6, 19))
>c : Symbol(c, Decl(callChain.2.ts, 6, 31))