|
| 1 | +=== tests/cases/compiler/eventEmitterPatternWithRecordOfFunction.ts === |
| 2 | +interface A { |
| 3 | +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 0, 0)) |
| 4 | + |
| 5 | + emit(event: string, ...args: any[]): boolean; |
| 6 | +>emit : Symbol(A.emit, Decl(eventEmitterPatternWithRecordOfFunction.ts, 0, 13)) |
| 7 | +>event : Symbol(event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 1, 9)) |
| 8 | +>args : Symbol(args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 1, 23)) |
| 9 | +} |
| 10 | + |
| 11 | +type Args<F> = F extends (...args: infer A) => void ? A : never; |
| 12 | +>Args : Symbol(Args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 2, 1)) |
| 13 | +>F : Symbol(F, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 10)) |
| 14 | +>F : Symbol(F, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 10)) |
| 15 | +>args : Symbol(args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 26)) |
| 16 | +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 40)) |
| 17 | +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 40)) |
| 18 | + |
| 19 | +type EventMap = Record<string, Function>; |
| 20 | +>EventMap : Symbol(EventMap, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 64)) |
| 21 | +>Record : Symbol(Record, Decl(lib.es5.d.ts, --, --)) |
| 22 | +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) |
| 23 | + |
| 24 | +interface B<M extends EventMap> extends A { |
| 25 | +>B : Symbol(B, Decl(eventEmitterPatternWithRecordOfFunction.ts, 6, 41)) |
| 26 | +>M : Symbol(M, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 12)) |
| 27 | +>EventMap : Symbol(EventMap, Decl(eventEmitterPatternWithRecordOfFunction.ts, 4, 64)) |
| 28 | +>A : Symbol(A, Decl(eventEmitterPatternWithRecordOfFunction.ts, 0, 0)) |
| 29 | + |
| 30 | + emit<Event extends keyof M>(event: Event, ...args: Args<M[Event]>): boolean; |
| 31 | +>emit : Symbol(B.emit, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 43)) |
| 32 | +>Event : Symbol(Event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 9)) |
| 33 | +>M : Symbol(M, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 12)) |
| 34 | +>event : Symbol(event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 32)) |
| 35 | +>Event : Symbol(Event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 9)) |
| 36 | +>args : Symbol(args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 45)) |
| 37 | +>Args : Symbol(Args, Decl(eventEmitterPatternWithRecordOfFunction.ts, 2, 1)) |
| 38 | +>M : Symbol(M, Decl(eventEmitterPatternWithRecordOfFunction.ts, 8, 12)) |
| 39 | +>Event : Symbol(Event, Decl(eventEmitterPatternWithRecordOfFunction.ts, 9, 9)) |
| 40 | +} |
0 commit comments