Skip to content

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

Closed
@karikera

Description

@karikera

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions