File: mutuallyRecursiveCallbacks.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 (22 lines) | stat: -rw-r--r-- 1,090 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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.
      Types of parameters 'bar' and 'foo' are incompatible.
        Type 'void' is not assignable to type 'Foo<unknown>'.


==== 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:       Types of parameters 'bar' and 'foo' are incompatible.
!!! error TS2322:         Type 'void' is not assignable to type 'Foo<unknown>'.