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

Class ambient declaration should not require redeclaring interface methods #6266

Closed
niagr opened this issue Dec 27, 2015 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@niagr
Copy link

niagr commented Dec 27, 2015

interface IFoo {
    func (str: string): number;
}

declare class CFoo implements IFoo {
    func2 (): void;
}

error TS2420: Class 'CFoo' incorrectly implements interface 'IFoo'.
Property 'func' is missing in type 'CFoo'.

Since this is just a declaration, we shouldn't have to manually redeclare all implemented methods, this should be implied by declaring that the class implements the interface. We are simply declaring that this class exists and it implements said interface and additionally defines these methods. The requirement for the class to implement those methods should only apply to the actual class definition.

@vladima vladima added the Duplicate An existing issue was already created label Dec 28, 2015
@vladima
Copy link
Contributor

vladima commented Dec 28, 2015

duplicate of #5468

@vladima vladima closed this as completed Dec 28, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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