File: iterableArrayPattern28.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (32 lines) | stat: -rw-r--r-- 3,448 bytes parent folder | download | duplicates (3)
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
tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,24): error TS2769: No overload matches this call.
  Overload 1 of 4, '(iterable?: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
    Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
      The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
        Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult<readonly [string, number], any>'.
          Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult<readonly [string, number], any>'.
            Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult<readonly [string, number]>'.
              Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'.
                Type '[string, boolean]' is not assignable to type 'readonly [string, number]'.
                  Type at position 1 in source is not compatible with type at position 1 in target.
                    Type 'boolean' is not assignable to type 'number'.
  Overload 2 of 4, '(entries?: readonly (readonly [string, number])[]): Map<string, number>', gave the following error.
    Type 'boolean' is not assignable to type 'number'.


==== tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts (1 errors) ====
    function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { }
    takeFirstTwoEntries(...new Map([["", 0], ["hello", true]]));
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 4, '(iterable?: Iterable<readonly [string, number]>): Map<string, number>', gave the following error.
!!! error TS2769:     Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<readonly [string, number]>'.
!!! error TS2769:       The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types.
!!! error TS2769:         Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult<readonly [string, number], any>'.
!!! error TS2769:           Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult<readonly [string, number], any>'.
!!! error TS2769:             Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult<readonly [string, number]>'.
!!! error TS2769:               Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'.
!!! error TS2769:                 Type '[string, boolean]' is not assignable to type 'readonly [string, number]'.
!!! error TS2769:                   Type at position 1 in source is not compatible with type at position 1 in target.
!!! error TS2769:                     Type 'boolean' is not assignable to type 'number'.
!!! error TS2769:   Overload 2 of 4, '(entries?: readonly (readonly [string, number])[]): Map<string, number>', gave the following error.
!!! error TS2769:     Type 'boolean' is not assignable to type 'number'.