11 lines
No EOL
1.1 KiB
Text
11 lines
No EOL
1.1 KiB
Text
tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'.
|
|
Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'.
|
|
Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'.
|
|
|
|
|
|
==== tests/cases/compiler/contextualTyping33.ts (1 errors) ====
|
|
function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return "foo"}]);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'.
|
|
!!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'.
|
|
!!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. |