TypeScript/tests/baselines/reference/propertyNameWithoutTypeAnnotation.types

62 lines
2.3 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/objectTypeLiteral/propertySignatures/propertyNameWithoutTypeAnnotation.ts ===
class C {
2015-04-13 23:01:57 +02:00
>C : C, Symbol(C, Decl(propertyNameWithoutTypeAnnotation.ts, 0, 0))
2014-08-15 23:33:16 +02:00
foo;
2015-04-13 23:01:57 +02:00
>foo : any, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 0, 9))
2014-08-15 23:33:16 +02:00
}
interface I {
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(propertyNameWithoutTypeAnnotation.ts, 2, 1))
2014-08-15 23:33:16 +02:00
foo;
2015-04-13 23:01:57 +02:00
>foo : any, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 4, 13))
2014-08-15 23:33:16 +02:00
}
var a: {
2015-04-13 23:01:57 +02:00
>a : { foo: any; }, Symbol(a, Decl(propertyNameWithoutTypeAnnotation.ts, 8, 3))
2014-08-15 23:33:16 +02:00
foo;
2015-04-13 23:01:57 +02:00
>foo : any, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 8, 8))
2014-08-15 23:33:16 +02:00
}
var b = {
2015-04-13 23:01:57 +02:00
>b : { foo: any; }, Symbol(b, Decl(propertyNameWithoutTypeAnnotation.ts, 12, 3))
2014-08-22 03:39:46 +02:00
>{ foo: null} : { foo: null; }
2014-08-15 23:33:16 +02:00
foo: null
2015-04-13 23:01:57 +02:00
>foo : null, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 12, 9))
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;
2015-04-13 23:01:57 +02:00
>r1 : any, Symbol(r1, Decl(propertyNameWithoutTypeAnnotation.ts, 17, 3))
>(new C()).foo : any, Symbol(C.foo, Decl(propertyNameWithoutTypeAnnotation.ts, 0, 9))
2014-08-15 23:33:16 +02:00
>(new C()) : C
>new C() : C
2015-04-13 23:01:57 +02:00
>C : typeof C, Symbol(C, Decl(propertyNameWithoutTypeAnnotation.ts, 0, 0))
>foo : any, Symbol(C.foo, Decl(propertyNameWithoutTypeAnnotation.ts, 0, 9))
2014-08-15 23:33:16 +02:00
var r2 = (<I>null).foo;
2015-04-13 23:01:57 +02:00
>r2 : any, Symbol(r2, Decl(propertyNameWithoutTypeAnnotation.ts, 18, 3))
>(<I>null).foo : any, Symbol(I.foo, Decl(propertyNameWithoutTypeAnnotation.ts, 4, 13))
2014-08-15 23:33:16 +02:00
>(<I>null) : I
><I>null : I
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(propertyNameWithoutTypeAnnotation.ts, 2, 1))
2015-04-13 21:36:11 +02:00
>null : null
2015-04-13 23:01:57 +02:00
>foo : any, Symbol(I.foo, Decl(propertyNameWithoutTypeAnnotation.ts, 4, 13))
2014-08-15 23:33:16 +02:00
var r3 = a.foo;
2015-04-13 23:01:57 +02:00
>r3 : any, Symbol(r3, Decl(propertyNameWithoutTypeAnnotation.ts, 19, 3))
>a.foo : any, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 8, 8))
>a : { foo: any; }, Symbol(a, Decl(propertyNameWithoutTypeAnnotation.ts, 8, 3))
>foo : any, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 8, 8))
2014-08-15 23:33:16 +02:00
var r4 = b.foo;
2015-04-13 23:01:57 +02:00
>r4 : any, Symbol(r4, Decl(propertyNameWithoutTypeAnnotation.ts, 20, 3))
>b.foo : any, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 12, 9))
>b : { foo: any; }, Symbol(b, Decl(propertyNameWithoutTypeAnnotation.ts, 12, 3))
>foo : any, Symbol(foo, Decl(propertyNameWithoutTypeAnnotation.ts, 12, 9))
2014-08-15 23:33:16 +02:00