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

9 lines
476 B
Plaintext
Raw Normal View History

2014-11-05 21:26:03 +01:00
tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ====
2014-07-13 01:04:16 +02:00
var x: boolean = (true ? 1 : ""); // should be an error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.