TypeScript/tests/baselines/reference/propertyNameWithoutTypeAnnotation.types

62 lines
818 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/propertyNameWithoutTypeAnnotation.ts ===
class C {
>C : C
2014-08-15 23:33:16 +02:00
foo;
>foo : any
2014-08-15 23:33:16 +02:00
}
interface I {
>I : I
2014-08-15 23:33:16 +02:00
foo;
>foo : any
2014-08-15 23:33:16 +02:00
}
var a: {
>a : { foo: any; }
2014-08-15 23:33:16 +02:00
foo;
>foo : any
2014-08-15 23:33:16 +02:00
}
var b = {
>b : { foo: any; }
2014-08-22 03:39:46 +02:00
>{ foo: null} : { foo: null; }
2014-08-15 23:33:16 +02:00
foo: null
>foo : null
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}
// These should all be of type 'any'
var r1 = (new C()).foo;
>r1 : any
>(new C()).foo : any
2014-08-15 23:33:16 +02:00
>(new C()) : C
>new C() : C
>C : typeof C
>foo : any
2014-08-15 23:33:16 +02:00
var r2 = (<I>null).foo;
>r2 : any
>(<I>null).foo : any
2014-08-15 23:33:16 +02:00
>(<I>null) : I
><I>null : I
>I : I
2015-04-13 21:36:11 +02:00
>null : null
>foo : any
2014-08-15 23:33:16 +02:00
var r3 = a.foo;
>r3 : any
>a.foo : any
>a : { foo: any; }
>foo : any
2014-08-15 23:33:16 +02:00
var r4 = b.foo;
>r4 : any
>b.foo : any
>b : { foo: any; }
>foo : any
2014-08-15 23:33:16 +02:00