私はtypescript(2.5.2)を学習しています。タイプの引数がTypescriptで代入可能なエラーではありません
function printPerson(person: {firstName: string; lastName: string}): void{
console.log(person.firstName + " " + person.lastName);
}
let geo = {firstName: "geo", lastName: "porz", sex: "M"};
printPerson(geo); //OK here
// TS2345 Argument of type ... is not assignable to parameter of type ...
printPerson({firstName: "geo", lastName: "porz", sex: "M"});
「新鮮な」オブジェクトは、 – Dummy
おかげでそれを調べる必要があり、これはトリッキーなポイント https://stackoverflow.com/questions/42537727/empty-interface-allow-any-object/42542804#42542804を説明します – geo