Skip to content

Conversation

@sgrekhov
Copy link
Contributor

No description provided.

Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, noted one typo (in a few sentences that are similar).

Another thing came to mind, for a different PR if that's more convenient:

It may look like an oversight that the patterns == e and != e allow e to be a <staticMemberShorthand> because this allows for <selector>* at the end, and we almost never have a constant expression when this sequence of <selector> is non-empty.

However, we can do a few things: == 'Hello'.length should be supported. So we should now be able to do == .aString.length as well. Similarly, == .myGenericStaticMethod<int> should be possible. It is probably a tricky exercise to find a suitable context type such that the comparison will be non-trivial, but it shouldn't be a big problem even if unrelated_type_equality_checks will complain.

There may be more, but I can't immediately come up with any other examples. Perhaps there would be some extra ones popping up by looking at the language specification section about constant expressions.

@sgrekhov
Copy link
Contributor Author

Thank you! Descriptions are updated. I'll add constants with non-empty selectors in a separate PR

@sgrekhov sgrekhov requested a review from eernstg December 19, 2024 15:43
Copy link
Member

@eernstg eernstg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@eernstg eernstg merged commit 6d2a3c5 into dart-lang:master Dec 19, 2024
2 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Dec 20, 2024
2024-12-19 sgrekhov22@gmail.com dart-lang/co19#2976. Add equality tests. Part 1. (dart-lang/co19#3021)
2024-12-19 sgrekhov22@gmail.com dart-lang/co19#2559. Add more augmented expression tests for class-like declarations (dart-lang/co19#3019)
2024-12-18 sgrekhov22@gmail.com Fix Finalizer_A01_t04.dart test (dart-lang/co19#3020)
2024-12-18 sgrekhov22@gmail.com dart-lang/co19#2559. Fix metadata tests (dart-lang/co19#3018)
2024-12-17 sgrekhov22@gmail.com dart-lang/co19#2559. Add metadata tests. Part 1. (dart-lang/co19#3017)
2024-12-16 sgrekhov22@gmail.com dart-lang/co19#2559. Add more augmented expression tests (dart-lang/co19#3016)
2024-12-16 sgrekhov22@gmail.com dart-lang/co19#2559. Add tests for reserved word `augmented` in constructors. Part 2. (dart-lang/co19#3015)

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try
Change-Id: Idf2d4813fdca6d4107ee17d508cf5f8b27b1b4ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401882
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants