File: contextualTyping24.errors.txt

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (11 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(this: void, a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'.
  Types of parameters 'a' and 'a' are incompatible.
    Type '{ (): number; (i: number): number; }' is not assignable to type 'string'.


==== tests/cases/compiler/contextualTyping24.ts (1 errors) ====
    var foo:(a:{():number; (i:number):number; })=>number; foo = function(this: void, a:string){return 5};
                                                          ~~~
!!! error TS2322: Type '(this: void, a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'.
!!! error TS2322:   Types of parameters 'a' and 'a' are incompatible.
!!! error TS2322:     Type '{ (): number; (i: number): number; }' is not assignable to type 'string'.