TypeScript/tests/baselines/reference/objectLiteralWidened.types

38 lines
1.3 KiB
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; }, Symbol(x,Decl(objectLiteralWidened.ts,2,3))
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, Symbol(foo,Decl(objectLiteralWidened.ts,2,9))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
bar: undefined
>bar : undefined, Symbol(bar,Decl(objectLiteralWidened.ts,3,14))
>undefined : undefined, Symbol(undefined)
2014-08-15 23:33:16 +02:00
}
var y = {
>y : { foo: any; bar: { baz: any; boo: any; }; }, Symbol(y,Decl(objectLiteralWidened.ts,7,3))
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, Symbol(foo,Decl(objectLiteralWidened.ts,7,9))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
bar: {
>bar : { baz: null; boo: undefined; }, Symbol(bar,Decl(objectLiteralWidened.ts,8,14))
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, Symbol(baz,Decl(objectLiteralWidened.ts,9,10))
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
boo: undefined
>boo : undefined, Symbol(boo,Decl(objectLiteralWidened.ts,10,18))
>undefined : undefined, Symbol(undefined)
2014-08-15 23:33:16 +02:00
}
}