TypeScript/tests/baselines/reference/contextualTyping21.errors.txt
Daniel Rosenwasser 6e77e2e810 Removed colons from diagnostic messages.
Also got rid of the 'terminalMessages' concept.
2014-10-28 00:48:58 -07:00

13 lines
No EOL
862 B
Text

tests/cases/compiler/contextualTyping21.ts(1,36): error TS2323: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'.
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'.
==== tests/cases/compiler/contextualTyping21.ts (1 errors) ====
var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1];
~~~
!!! error TS2323: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'.
!!! error TS2323: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'.
!!! error TS2323: Type 'number' is not assignable to type '{ id: number; }'.
!!! error TS2323: Property 'id' is missing in type 'Number'.