TypeScript/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument2.errors.txt
2014-11-11 11:31:45 -08:00

14 lines
728 B
Plaintext

tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts(7,5): error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ a: string; id: number; }'.
==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts (1 errors) ====
var id: number = 10000;
var name: string = "my name";
var person = { name, id };
function foo(p: { a: string; id: number }) { }
foo(person); // error
~~~~~~
!!! error TS2345: Argument of type '{ name: string; id: number; }' is not assignable to parameter of type '{ a: string; id: number; }'.