/
globalThisUnknownNoImplicitAny.errors.txt
36 lines (31 loc) · 2.41 KB
/
globalThisUnknownNoImplicitAny.errors.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
tests/cases/conformance/es2019/globalThisUnknownNoImplicitAny.ts(4,5): error TS2339: Property 'hi' does not exist on type 'Window & typeof globalThis'.
tests/cases/conformance/es2019/globalThisUnknownNoImplicitAny.ts(5,6): error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
tests/cases/conformance/es2019/globalThisUnknownNoImplicitAny.ts(6,12): error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
tests/cases/conformance/es2019/globalThisUnknownNoImplicitAny.ts(8,5): error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
tests/cases/conformance/es2019/globalThisUnknownNoImplicitAny.ts(9,1): error TS7053: Element implicitly has an 'any' type because expression of type '"hi"' can't be used to index type 'typeof globalThis'.
Property 'hi' does not exist on type 'typeof globalThis'.
tests/cases/conformance/es2019/globalThisUnknownNoImplicitAny.ts(10,1): error TS7053: Element implicitly has an 'any' type because expression of type '"hi"' can't be used to index type 'typeof globalThis'.
Property 'hi' does not exist on type 'typeof globalThis'.
==== tests/cases/conformance/es2019/globalThisUnknownNoImplicitAny.ts (6 errors) ====
declare let win: Window & typeof globalThis;
// all accesses should be errors
win.hi
~~
!!! error TS2339: Property 'hi' does not exist on type 'Window & typeof globalThis'.
this.hi
~~
!!! error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
globalThis.hi
~~
!!! error TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
win['hi']
~~~~
!!! error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
this['hi']
~~~~~~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"hi"' can't be used to index type 'typeof globalThis'.
!!! error TS7053: Property 'hi' does not exist on type 'typeof globalThis'.
globalThis['hi']
~~~~~~~~~~~~~~~~
!!! error TS7053: Element implicitly has an 'any' type because expression of type '"hi"' can't be used to index type 'typeof globalThis'.
!!! error TS7053: Property 'hi' does not exist on type 'typeof globalThis'.