mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
11 lines
356 B
TypeScript
11 lines
356 B
TypeScript
|
// @lib: es5
|
|||
|
var id: number = 10000;
|
|||
|
var name: string = "my name";
|
|||
|
|
|||
|
var person: { b: string; id: number } = { name, id }; // error
|
|||
|
var person1: { name, id }; // ok
|
|||
|
function foo(name: string, id: number): { id: string, name: number } { return { name, id }; } // error
|
|||
|
function bar(obj: { name: string; id: boolean }) { }
|
|||
|
bar({ name, id }); // error
|
|||
|
|