31 lines
961 B
Text
31 lines
961 B
Text
|
=== tests/cases/compiler/doNotWidenAtObjectLiteralPropertyAssignment.ts ===
|
||
|
interface ITestEventInterval {
|
||
|
>ITestEventInterval : ITestEventInterval
|
||
|
|
||
|
begin: number;
|
||
|
>begin : number
|
||
|
}
|
||
|
|
||
|
interface IIntervalTreeNode {
|
||
|
>IIntervalTreeNode : IIntervalTreeNode
|
||
|
|
||
|
interval: ITestEventInterval;
|
||
|
>interval : ITestEventInterval
|
||
|
>ITestEventInterval : ITestEventInterval
|
||
|
|
||
|
children?: IIntervalTreeNode[];
|
||
|
>children : IIntervalTreeNode[]
|
||
|
>IIntervalTreeNode : IIntervalTreeNode
|
||
|
}
|
||
|
|
||
|
var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // was error here because best common type is {}
|
||
|
>test : IIntervalTreeNode[]
|
||
|
>IIntervalTreeNode : IIntervalTreeNode
|
||
|
>[{ interval: { begin: 0 }, children: null }] : IIntervalTreeNode[]
|
||
|
>{ interval: { begin: 0 }, children: null } : { interval: { begin: number; }; children: null; }
|
||
|
>interval : { begin: number; }
|
||
|
>{ begin: 0 } : { begin: number; }
|
||
|
>begin : number
|
||
|
>children : any
|
||
|
|