TypeScript/tests/baselines/reference/objectLiteralWidened.types

38 lines
1.3 KiB
Plaintext
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 = {
2015-04-13 23:01:57 +02:00
>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,
2015-04-13 23:01:57 +02:00
>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
2015-04-13 23:01:57 +02:00
>bar : undefined, Symbol(bar, Decl(objectLiteralWidened.ts, 3, 14))
>undefined : undefined, Symbol(undefined)
2014-08-15 23:33:16 +02:00
}
var y = {
2015-04-13 23:01:57 +02:00
>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,
2015-04-13 23:01:57 +02:00
>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: {
2015-04-13 23:01:57 +02:00
>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,
2015-04-13 23:01:57 +02:00
>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
2015-04-13 23:01:57 +02:00
>boo : undefined, Symbol(boo, Decl(objectLiteralWidened.ts, 10, 18))
>undefined : undefined, Symbol(undefined)
2014-08-15 23:33:16 +02:00
}
}