-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decide whether to allow private symbol constants #36433
Comments
@leafpetersen @lrhn can you all talk with @askeksa-google to make a call here? |
I'd prefer allowing There is no reasonable way to make the |
Do we need to fix this for 2.3? It sounds like the existing |
I agree with @lrhn that allowing We only need this for 2.3 if some important code is depending on creating these symbols. I spoke with @sjindel-google about it, and he only knew of uses in tests. |
So as I understand this:
I think it sounds reasonable to me to aim to ship 2.3 without supporting I just searched in internal code for uses of cc @keertip |
@leafpetersen - is there anything we need to land to unblock 2.3? |
The plan is no. In the hopefully very unlikely case that we get failures in google3 because someone was creating a private symbol via |
@leafpetersen, found uses in third party packages source_gen and matcher. The one in matcher is likely not used, source_gen is used. |
Do you know what the symbol is that it is trying to produce/where it comes from? |
Actually, @keertip I'm very confused - neither of those uses are const. @askeksa-google did the non-const behavior change as well, or was it already correct? @keertip can you send me a log with a test failure? |
@leafpetersen , my bad. missed the const, only saw the private symbol. Please ignore my comment. |
Moving this out of 2.3. |
There should not be any difference between the result of (Not the issue here, that's whether you can create a private name using |
These two tests will need to be updated to reflect this change:
|
These tests will be marked as skipped by https://dart-review.googlesource.com/c/sdk/+/99169. Unskip when the tests are fixed. |
Fixes #32517 Fixes #34189 Fixes #34192 Fixes #34205 Unskipping the skipped tests is tracked by #36433 and #36595. Expectation files for front-end tests will need to be updated to make front-end builders green. They are part of unapprovable suites. Change-Id: I311f449af6feff5bf40740227a95aa06e0a9d84f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99169 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
See also dart-lang/language#301 |
I am deleting language_2/mock_writable_final_private_field_test because there is currently no way to port it to constant update enabled VM. |
Symbol constructor can't be used to create symbols for private names. Closes #34377 Closes #30848 #36433 #34904 Change-Id: Ibe551c43a9209e1f483cea8178665890d52799aa Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108416 Reviewed-by: Vyacheslav Egorov <vegorov@google.com> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Closing this in favor of the language tracking issue here |
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
andlanguage_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/+/97927The text was updated successfully, but these errors were encountered: