Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement inherited abstract method does not know the parameter types #17846

Closed
TheColorRed opened this issue Aug 16, 2017 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@TheColorRed
Copy link

TheColorRed commented Aug 16, 2017

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?

@DanielRosenwasser
Copy link
Member

Duplicate of #1373.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Aug 16, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants