TypeScript/tests/baselines/reference/assignmentCompat1.types
Wesley Wigham 5353475fce Always collect type and symbol baselines (#18621)
* Always generate type & symbol baselines

* Accept changed shadowed baselines

* Accept brand new type and symbol baselines

* Allow `getTypeAtLocation` to return undefined in the type writer

* Accept baselines which had missing type information

* Bind container for dynamically names enum members so they may be printed

* Accept type/symbol baselines for enums with computed members

* First pass at reducing typeWriter memory overhead

* Use generators to allow for type and symbol baselines with no cache

* Accept new baselines for tests whose output was fixed by better newline splitting

* Hard cap on number of declarations printed, cache declaration print text

* handle differing newlines better still to handle RWC newlines

* Lower abridging count, accept abridged baselines

* Limit max RWC error output size, limit RWC type and symbol baseline input size

* Move skip logic into type and symbol baseliner to streamline error handling

* Accept removal of empty baselines

* Canonicalize path earlier to handle odd paths in input files

* Do canonicalization earlier still, also ensure parallel perf profiles for different targets do not trample one another

* No need to pathify again
2017-09-22 15:52:04 -07:00

52 lines
1.1 KiB
Plaintext

=== tests/cases/compiler/assignmentCompat1.ts ===
var x = { one: 1 };
>x : { one: number; }
>{ one: 1 } : { one: number; }
>one : number
>1 : 1
var y: { [index: string]: any };
>y : { [index: string]: any; }
>index : string
var z: { [index: number]: any };
>z : { [index: number]: any; }
>index : number
x = y; // Error
>x = y : { [index: string]: any; }
>x : { one: number; }
>y : { [index: string]: any; }
y = x; // Ok because index signature type is any
>y = x : { one: number; }
>y : { [index: string]: any; }
>x : { one: number; }
x = z; // Error
>x = z : { [index: number]: any; }
>x : { one: number; }
>z : { [index: number]: any; }
z = x; // Ok because index signature type is any
>z = x : { one: number; }
>z : { [index: number]: any; }
>x : { one: number; }
y = "foo"; // Error
>y = "foo" : "foo"
>y : { [index: string]: any; }
>"foo" : "foo"
z = "foo"; // OK, string has numeric indexer
>z = "foo" : "foo"
>z : { [index: number]: any; }
>"foo" : "foo"
z = false; // Error
>z = false : false
>z : { [index: number]: any; }
>false : false