21 lines
No EOL
1,023 B
Text
21 lines
No EOL
1,023 B
Text
tests/cases/compiler/functionSignatureAssignmentCompat1.ts(10,5): error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc':
|
|
Types of parameters 'delimiter' and 'eventEmitter' are incompatible:
|
|
Type 'string' is not assignable to type 'number'.
|
|
|
|
|
|
==== tests/cases/compiler/functionSignatureAssignmentCompat1.ts (1 errors) ====
|
|
interface ParserFunc {
|
|
(eventEmitter: number, buffer: string): void;
|
|
}
|
|
interface Parsers {
|
|
raw: ParserFunc;
|
|
readline(delimiter?: string): ParserFunc;
|
|
}
|
|
var parsers: Parsers;
|
|
var c: ParserFunc = parsers.raw; // ok!
|
|
var d: ParserFunc = parsers.readline; // not ok
|
|
~
|
|
!!! error TS2322: Type '(delimiter?: string) => ParserFunc' is not assignable to type 'ParserFunc':
|
|
!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible:
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
|
var e: ParserFunc = parsers.readline(); // ok |