mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
25 lines
559 B
TypeScript
25 lines
559 B
TypeScript
//// [tests/cases/conformance/types/nonPrimitive/nonPrimitiveAsProperty.ts] ////
|
|
|
|
//// [nonPrimitiveAsProperty.ts]
|
|
interface WithNonPrimitive {
|
|
foo: object
|
|
}
|
|
|
|
var a: WithNonPrimitive = { foo: {bar: "bar"} };
|
|
|
|
var b: WithNonPrimitive = {foo: "bar"}; // expect error
|
|
|
|
|
|
//// [nonPrimitiveAsProperty.js]
|
|
"use strict";
|
|
var a = { foo: { bar: "bar" } };
|
|
var b = { foo: "bar" }; // expect error
|
|
|
|
|
|
//// [nonPrimitiveAsProperty.d.ts]
|
|
interface WithNonPrimitive {
|
|
foo: object;
|
|
}
|
|
declare var a: WithNonPrimitive;
|
|
declare var b: WithNonPrimitive;
|