TypeScript/tests/cases/compiler/indexedAccessKeyofNestedSimplifiedSubstituteUnwrapped.ts
Wesley Wigham 15dd0002ef
Unwrap substitutions both before _and_ after potential simplification (#32116)
* Unwrap substitutions both before _and_ after potential simplification

* Repeatedly unwrap/simplify until no more can be performed

* Use seperate loops for source and target to reduce redundant calls

* Move loop into function

* Inline worker
2020-02-25 17:36:56 -08:00

22 lines
388 B
TypeScript

type AnyFunction = (...args: any[]) => any;
type Params<T> = Parameters<Extract<T, AnyFunction>>;
interface Wrapper<T> {
call<K extends keyof T>(event: K, ...args: Params<T[K]>): void;
}
interface AWrapped {
foo(): void;
}
class A {
foo: Wrapper<AWrapped>;
}
interface BWrapped extends AWrapped {
bar(): void;
}
class B extends A {
foo: Wrapper<BWrapped>;
}