TypeScript/tests/baselines/reference/optionalParamTypeComparison.errors.txt

14 lines
653 B
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/optionalParamTypeComparison.ts (2 errors) ====
var f: (s: string, n?: number) => void;
var g: (s: string, b?: boolean) => void;
f = g;
~
!!! Type '(s: string, b?: boolean) => void' is not assignable to type '(s: string, n?: number) => void':
!!! Types of parameters 'b' and 'n' are incompatible:
!!! Type 'boolean' is not assignable to type 'number'.
g = f;
~
!!! Type '(s: string, n?: number) => void' is not assignable to type '(s: string, b?: boolean) => void':
!!! Types of parameters 'n' and 'b' are incompatible:
!!! Type 'number' is not assignable to type 'boolean'.