mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 01:13:56 +03:00
b887b30092
**Description:** This is required for https://github.com/swc-project/swc/pull/6981 and https://github.com/swc-project/swc/pull/6950
10 lines
437 B
TypeScript
10 lines
437 B
TypeScript
// @lib: es5
|
|
var id: number = 10000;
|
|
var name: string = "my name";
|
|
|
|
var person: { b: string; id: number } = { name, id }; // error
|
|
function bar(name: string, id: number): { name: number, id: string } { return { name, id }; } // error
|
|
function foo(name: string, id: number): { name: string, id: number } { return { name, id }; } // error
|
|
var person1: { name, id }; // ok
|
|
var person2: { name: string, id: number } = bar("hello", 5);
|