2014-10-18 01:53:18 +02:00
|
|
|
tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]':
|
2014-10-08 22:48:44 +02:00
|
|
|
Type 'number | { id: number; }' is not assignable to type '{ id: number; }':
|
|
|
|
Type 'number' is not assignable to type '{ id: number; }':
|
|
|
|
Property 'id' is missing in type 'Number'.
|
2014-09-12 22:35:07 +02:00
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/contextualTyping21.ts (1 errors) ====
|
|
|
|
var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1];
|
|
|
|
~~~
|
2014-10-18 01:53:18 +02:00
|
|
|
!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]':
|
2014-10-08 22:48:44 +02:00
|
|
|
!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }':
|
|
|
|
!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }':
|
|
|
|
!!! error TS2322: Property 'id' is missing in type 'Number'.
|