Closed
Description
TypeScript Version: 2.4.2
Code
Middleware.ts
import { Request, Response, NextFunction } from 'express'
export abstract class Middleware {
public abstract handle(req: Request, res: Response, next: NextFunction);
}
Auth.ts
import { Middleware } from '.'
export class Auth extends Middleware {
public handle(req, res, next) {
}
}
Within the Auth
class which extends Middleware
the handle
method has three parameters which are define in Middleware
. In my vscode editor, within the Auth
class those types are all any
. I was expecting that those types would be read from the parent from which they were defined. However, they do not do this.
Since Auth
knows if an abstract method has or has not been defined, shouldn't it also know the parameter types of the abstract method?