Skip to content

No way to create symbol representing private setter name #34904

Closed
@sjindel-google

Description

@sjindel-google

According to the documentation, the constructor for const Symbol() does not accept private names. The only other way to construct a constant symbol is via the #... notation, e.g. #_x. However, this doesn't work for names of setters, e.g. _x=, because #_x= isn't syntactically correct.

How can the name of a private setter be expressed as a constant symbol?

For reference, I'm updating the mock_writable_final_private_field_test.dart which is currently exploiting an incorrect behavior in the VM to do this. The VM currently allows creating a private symbol in this way, but it is not correctly mangled.

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.core-ltype-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions