1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
tests/cases/compiler/lambdaArgCrash.ts(27,25): error TS2304: Cannot find name 'ItemSet'.
tests/cases/compiler/lambdaArgCrash.ts(29,14): error TS2345: Argument of type '(items: any) => void' is not assignable to parameter of type '() => any'.
==== tests/cases/compiler/lambdaArgCrash.ts (2 errors) ====
class Event {
private _listeners: any[] = [];
constructor () {
// TODO: remove
this._listeners = [];
}
add(listener: () => any): void {
/// <summary>Registers a new listener for the event.</summary>
/// <param name="listener">The callback function to register.</param>
this._listeners.push(listener);
}
}
class ItemSetEvent extends Event {
add(listener: (items: ItemSet) => void ) {
~~~~~~~
!!! error TS2304: Cannot find name 'ItemSet'.
super.add(listener);
~~~~~~~~
!!! error TS2345: Argument of type '(items: any) => void' is not assignable to parameter of type '() => any'.
}
}
|