Skip to content

Private symbol class properties treated as public #20080

Closed
@dpogue

Description

@dpogue

TypeScript Version: 2.7.0-dev.20171116

Code

const _data = Symbol('data');

export class User {
    private [_data] : any;
};

Expected behavior:
Compiles successfully.

Actual behavior:
TS4031: Public property '[_data]' of exported class has or is using private name '_data'.

The issue is that [_data] is not a public property, so it shouldn't care if it's using a private name because it's not meant to be visible outside of the User class.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions