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