mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Test to repro crash
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
declare interface Foo {
|
||||
a(): boolean;
|
||||
b(): void;
|
||||
c(argument: boolean): void;
|
||||
d(argument: number): void;
|
||||
}
|
||||
|
||||
declare const Foo: Mapped<Foo>;
|
||||
type Mapped<T> = {
|
||||
[K in keyof T]: T[K] extends (...args: infer Args) => infer R
|
||||
? (...args: Args) => R
|
||||
: never;
|
||||
};
|
||||
|
||||
function foo(key: 'a' | 'b' | 'c' | 'd') {
|
||||
Foo[key]();
|
||||
}
|
||||
Reference in New Issue
Block a user