TypeScript/tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts
2017-10-18 16:59:43 -07:00

21 lines
384 B
TypeScript

// @strict: true
// Repro from #19316
type ComputedOf<T> = {
[K in keyof T]: () => T[K];
}
declare function foo<P, C>(options: { props: P, computed: ComputedOf<C> } & ThisType<P & C>): void;
foo({
props: { x: 10, y: 20 },
computed: {
bar(): number {
let z = this.bar;
return 42;
},
baz: 42
}
});