mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
22 lines
1.1 KiB
Plaintext
22 lines
1.1 KiB
Plaintext
functionSignatureAssignmentCompat1.ts(10,21): error TS2322: Type '(delimiter?: string | undefined) => ParserFunc' is not assignable to type 'ParserFunc'.
|
|
Types of parameters 'delimiter' and 'eventEmitter' are incompatible.
|
|
Type 'number' is not assignable to type 'string'.
|
|
|
|
|
|
==== functionSignatureAssignmentCompat1.ts (1 errors) ====
|
|
interface ParserFunc {
|
|
(eventEmitter: number, buffer: string): void;
|
|
}
|
|
interface Parsers {
|
|
raw: ParserFunc;
|
|
readline(delimiter?: string): ParserFunc;
|
|
}
|
|
declare var parsers: Parsers;
|
|
var c: ParserFunc = parsers.raw; // ok!
|
|
var d: ParserFunc = parsers.readline; // not ok
|
|
~~~~~~~~~~~~~~~~
|
|
!!! error TS2322: Type '(delimiter?: string | undefined) => ParserFunc' is not assignable to type 'ParserFunc'.
|
|
!!! error TS2322: Types of parameters 'delimiter' and 'eventEmitter' are incompatible.
|
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
|
!!! related TS6212 functionSignatureAssignmentCompat1.ts:10:21: Did you mean to call this expression?
|
|
var e: ParserFunc = parsers.readline(); // ok |