b6d083fa40
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.
41 lines
890 B
Plaintext
41 lines
890 B
Plaintext
=== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType6.ts ===
|
|
interface I<T> {
|
|
>I : I<T>
|
|
>T : T
|
|
|
|
[s: string]: T;
|
|
>s : string
|
|
>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]}) : string | number | boolean | (() => void) | number[]
|
|
>foo : <T>(obj: I<T>) => T
|
|
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => 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[]
|
|
|
|
});
|