File: emitCapturingThisInTupleDestructuring2.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 (16 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts(8,39): error TS2493: Tuple type '[number, number]' of length '2' has no element at index '2'.


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