Skip to content

Decide whether to allow private symbol constants #36433

@askeksa-google

Description

@askeksa-google

The specification does not permit the string in const Symbol(string) to construct a private symbol. The new constant evaluator enforces this limitation, causing two tests, language_2/mock_writable_final_private_field_test and language_2/vm/reflect_core_vm_test, to fail.

The issue is discussed further in #34904.

We need to decide before enabling the new constant evaluator whether this use case is essential enough to loosen up the compile-time verification of const Symbol (or, alternatively, to allow = at the end of symbol literals). The change to do the former is here: https://dart-review.googlesource.com/c/sdk/+/97927

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).legacy-area-front-endLegacy: Use area-dart-model instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions