File: emitCapturingThisInTupleDestructuring1.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (13 lines) | stat: -rw-r--r-- 845 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,17): error TS2493: Tuple type '[any]' of length '1' has no element at index '1'.
tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts(3,29): error TS2493: Tuple type '[any]' of length '1' has no element at index '2'.


==== tests/cases/compiler/emitCapturingThisInTupleDestructuring1.ts (2 errors) ====
    declare function wrapper(x: any);
    wrapper((array: [any]) => {
        [this.test, this.test1, this.test2] = array;  // even though there is a compiler error, we should still emit lexical capture for "this"
                    ~~~~~~~~~~
!!! error TS2493: Tuple type '[any]' of length '1' has no element at index '1'.
                                ~~~~~~~~~~
!!! error TS2493: Tuple type '[any]' of length '1' has no element at index '2'.
    });