Skip to content

Private check can be bypassed by ElementAccessExpression #42360

@Jack-Works

Description

@Jack-Works

Bug Report

🔎 Search Terms

bypass private element access

🕗 Version & Regression Information

  • I tested it on the master branch

💻 Code

class X { private x: number }
new X()['x']

🙁 Actual behavior

No error

🙂 Expected behavior

Type Error

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions