Files
tsgo/testdata/baselines/reference/submodule/compiler/emitCapturingThisInTupleDestructuring1.errors.txt

34 lines
2.6 KiB
Plaintext

emitCapturingThisInTupleDestructuring1.ts(1,18): error TS7010: 'wrapper', which lacks return-type annotation, implicitly has an 'any' return type.
emitCapturingThisInTupleDestructuring1.ts(3,6): error TS7041: The containing arrow function captures the global value of 'this'.
emitCapturingThisInTupleDestructuring1.ts(3,11): error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
emitCapturingThisInTupleDestructuring1.ts(3,17): error TS7041: The containing arrow function captures the global value of 'this'.
emitCapturingThisInTupleDestructuring1.ts(3,17): error TS2493: Tuple type '[any]' of length '1' has no element at index '1'.
emitCapturingThisInTupleDestructuring1.ts(3,22): error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
emitCapturingThisInTupleDestructuring1.ts(3,29): error TS7041: The containing arrow function captures the global value of 'this'.
emitCapturingThisInTupleDestructuring1.ts(3,29): error TS2493: Tuple type '[any]' of length '1' has no element at index '2'.
emitCapturingThisInTupleDestructuring1.ts(3,34): error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
==== emitCapturingThisInTupleDestructuring1.ts (9 errors) ====
declare function wrapper(x: any);
~~~~~~~
!!! error TS7010: 'wrapper', which lacks return-type annotation, implicitly has an 'any' return type.
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 TS7041: The containing arrow function captures the global value of 'this'.
~~~~
!!! error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
~~~~
!!! error TS7041: The containing arrow function captures the global value of 'this'.
~~~~~~~~~~
!!! error TS2493: Tuple type '[any]' of length '1' has no element at index '1'.
~~~~~
!!! error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
~~~~
!!! error TS7041: The containing arrow function captures the global value of 'this'.
~~~~~~~~~~
!!! error TS2493: Tuple type '[any]' of length '1' has no element at index '2'.
~~~~~
!!! error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
});