mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 14:43:33 +03:00
20 lines
387 B
TypeScript
20 lines
387 B
TypeScript
// @declaration: true
|
|
function takeObject(o: object) {}
|
|
function returnObject(): object {
|
|
return {};
|
|
}
|
|
|
|
var nonPrimitive: object;
|
|
var primitive: boolean;
|
|
|
|
takeObject(nonPrimitive);
|
|
nonPrimitive = returnObject();
|
|
|
|
takeObject(primitive); // expect error
|
|
primitive = returnObject(); // expect error
|
|
|
|
function returnError(): object {
|
|
var ret = 123;
|
|
return ret; // expect error
|
|
}
|