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

TS4094 error occurred, even if the parent has a protected member (declaration: true) #47186

Closed
karikera opened this issue Dec 18, 2021 · 4 comments

Comments

@karikera
Copy link

karikera commented Dec 18, 2021

Bug Report

πŸ”Ž Search Terms

ts4094 parent
ts4094 extends

πŸ•— Version & Regression Information

4.6.0-dev.20211218

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________

⏯ Playground Link

[Playground link with relevant code]

  • The playground doesn't show this error. it needs "declaration": true

πŸ’» Code

class Foo {
    protected a = 0;
}
const a = new class extends Foo {};

πŸ™ Actual behavior

ts4094, Property 'a' of exported class expression may not be private or protected.ts(4094)

πŸ™‚ Expected behavior

no error.
'a' can be accessed by the other child classes.

@MartinJohns
Copy link
Contributor

The playground doesn't show this error. it needs "declaration": true

It does, when you add // @declaration: true.

@MartinJohns
Copy link
Contributor

I don't see any difference to #17293.

@fatcerberus
Copy link

I believe this could be fixed if #41587 were implemented. Right now it looks like a design limitation, as explained in #17293.

@karikera
Copy link
Author

I don't see any difference to #17293.

I felt it little different but it seems almost same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants