mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 04:01:39 +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
|
|
|