-
-
Notifications
You must be signed in to change notification settings - Fork 184
Closed
Labels
Description
/** @noSelf */
declare namespace Test {
export function testCallback<T extends (...args: any[]) => void>(
callback: T,
): FunctionContainer<T>;
}
testCallback(() => {});
This fails with error TSTL: Unable to convert function with a 'this' parameter to function 'callback' with no 'this'. To fix, wrap in an arrow function, or declare with 'this: void'..
validateFunctionAssignment fails here. I could make it work by returning immediately if toType.isTypeParameter() is true, but I suspect that's not the correct solution to this particular problem.
Reactions are currently unavailable