TypeScript/tests/baselines/reference/computedPropertyNamesContextualType7.types.pull
Cyrus Najmabadi b6d083fa40 Do not publicly expose a way on a Program instance to get typecheckers with differing behavior.
Now, you can only get the non-diagnostics, pull-type-checker from the Program instance.
If you want diagnostics, you simply ask the Program instance for the diagnostics you want.
2015-02-04 16:11:38 -08:00

41 lines
852 B
Plaintext

=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType7.ts ===
interface I<T> {
>I : I<T>
>T : T
[s: number]: T;
>s : number
>T : T
}
declare function foo<T>(obj: I<T>): T
>foo : <T>(obj: I<T>) => T
>T : T
>obj : I<T>
>I : I<T>
>T : T
>T : T
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[]
>foo : <T>(obj: I<T>) => T
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | (() => void) | number[]; 0: () => void; p: string; }
p: "",
>p : string
0: () => { },
>() => { } : () => void
["hi" + "bye"]: true,
>"hi" + "bye" : string
[0 + 1]: 0,
>0 + 1 : number
[+"hi"]: [0]
>+"hi" : number
>[0] : number[]
});