File: mutuallyRecursiveCallbacks.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 (24 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type '<T>(bar: Bar<T>) => void' is not assignable to type 'Bar<{}>'.
  Types of parameters 'bar' and 'foo' are incompatible.
    Types of parameters 'bar' and 'foo' are incompatible.
      Type 'Foo<{}>' is not assignable to type 'Bar<{}>'.
        Types of parameters 'bar' and 'foo' are incompatible.
          Type 'void' is not assignable to type 'Foo<{}>'.


==== tests/cases/compiler/mutuallyRecursiveCallbacks.ts (1 errors) ====
    // Repro from #18277
    
    interface Foo<T> { (bar: Bar<T>): void };
    type Bar<T> = (foo: Foo<T>) => Foo<T>;
    declare function foo<T>(bar: Bar<T>): void;
    declare var bar: Bar<{}>;
    bar = foo;
    ~~~
!!! error TS2322: Type '<T>(bar: Bar<T>) => void' is not assignable to type 'Bar<{}>'.
!!! error TS2322:   Types of parameters 'bar' and 'foo' are incompatible.
!!! error TS2322:     Types of parameters 'bar' and 'foo' are incompatible.
!!! error TS2322:       Type 'Foo<{}>' is not assignable to type 'Bar<{}>'.
!!! error TS2322:         Types of parameters 'bar' and 'foo' are incompatible.
!!! error TS2322:           Type 'void' is not assignable to type 'Foo<{}>'.