swc/crates/swc_ecma_parser/tests/tsc/nonPrimitiveAsProperty.ts

9 lines
176 B
TypeScript

// @declaration: true
interface WithNonPrimitive {
foo: object
}
var a: WithNonPrimitive = { foo: {bar: "bar"} };
var b: WithNonPrimitive = {foo: "bar"}; // expect error