mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Test to repro crash
This commit is contained in:
parent
737a9312cb
commit
fc4ac8feca
17
tests/cases/compiler/getSignatureOfTypeCrash.ts
Normal file
17
tests/cases/compiler/getSignatureOfTypeCrash.ts
Normal file
@ -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]();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user