Skip to content

Impossible implement another class with private fields #17490

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

Closed
cevek opened this issue Jul 28, 2017 · 1 comment
Closed

Impossible implement another class with private fields #17490

cevek opened this issue Jul 28, 2017 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@cevek
Copy link

cevek commented Jul 28, 2017

TypeScript Version: 2.5.0 nightly

Code

class Foo {
    baz: string;
    private foo: string; 
}

//TS2420:Class 'Bar' incorrectly implements interface 'Foo'.
//  Property 'foo' is missing in type 'Bar'.
class Bar implements Foo {
    baz: string;
}

But if add private member foo to Bar it throws
TS2420:Class 'Bar' incorrectly implements interface 'Foo'.
Types have separate declarations of a private property 'foo'.

@cevek cevek changed the title Impossible implement another class with private keys Impossible implement another class with private fields Jul 28, 2017
@RyanCavanaugh RyanCavanaugh added Working as Intended The behavior described is the intended behavior; this is not a bug Duplicate An existing issue was already created and removed Working as Intended The behavior described is the intended behavior; this is not a bug labels Jul 28, 2017
@RyanCavanaugh
Copy link
Member

See #471

@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