mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
29 lines
1.0 KiB
Plaintext
29 lines
1.0 KiB
Plaintext
destructuringControlFlowNoCrash.ts(3,3): error TS2339: Property 'date' does not exist on type '(inspectedElement: any) => number'.
|
|
destructuringControlFlowNoCrash.ts(10,3): error TS2339: Property 'date2' does not exist on type '(inspectedElement: any) => any'.
|
|
destructuringControlFlowNoCrash.ts(11,28): error TS1005: '=>' expected.
|
|
|
|
|
|
==== destructuringControlFlowNoCrash.ts (3 errors) ====
|
|
// legal JS, if nonsensical, which also triggers the issue
|
|
const {
|
|
date,
|
|
~~~~
|
|
!!! error TS2339: Property 'date' does not exist on type '(inspectedElement: any) => number'.
|
|
} = (inspectedElement: any) => 0;
|
|
|
|
date.toISOString();
|
|
|
|
// Working flow code
|
|
const {
|
|
date2,
|
|
~~~~~
|
|
!!! error TS2339: Property 'date2' does not exist on type '(inspectedElement: any) => any'.
|
|
} = (inspectedElement: any).props;
|
|
~
|
|
!!! error TS1005: '=>' expected.
|
|
|
|
date2.toISOString();
|
|
|
|
// It could also be an async function
|
|
const { constructor } = async () => {};
|
|
|