TypeScript/tests/baselines/reference/objectLiteralWidened.types

35 lines
824 B
Text
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/typeRelationships/widenedTypes/objectLiteralWidened.ts ===
// object literal properties are widened to any
var x = {
>x : { foo: any; bar: any; }
2014-08-22 03:39:46 +02:00
>{ foo: null, bar: undefined} : { foo: null; bar: undefined; }
2014-08-15 23:33:16 +02:00
foo: null,
>foo : null
2014-08-15 23:33:16 +02:00
bar: undefined
>bar : undefined
2014-08-15 23:33:16 +02:00
>undefined : undefined
}
var y = {
>y : { foo: any; bar: { baz: any; boo: any; }; }
2014-08-22 03:39:46 +02:00
>{ foo: null, bar: { baz: null, boo: undefined }} : { foo: null; bar: { baz: null; boo: undefined; }; }
2014-08-15 23:33:16 +02:00
foo: null,
>foo : null
2014-08-15 23:33:16 +02:00
bar: {
>bar : { baz: null; boo: undefined; }
2014-08-22 03:39:46 +02:00
>{ baz: null, boo: undefined } : { baz: null; boo: undefined; }
2014-08-15 23:33:16 +02:00
baz: null,
>baz : null
2014-08-15 23:33:16 +02:00
boo: undefined
>boo : undefined
2014-08-15 23:33:16 +02:00
>undefined : undefined
}
}