-
Notifications
You must be signed in to change notification settings - Fork 29
Fixes #3170. Fix spread collections tests #3171
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
Conversation
eernstg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one comment (occurring in about 4 locations) is a little bit confusing, and I suggested a way to make it clearer.
|
|
||
| main() { | ||
| var list = <num>[ | ||
| ....castFrom<num, int>([1, 2, 3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! So we can test the actual behavior in a non-error way, too. I hadn't thought of this way to do it.
| main() { | ||
| var l1 = <C>[ | ||
| ....one, | ||
| ....one, // `...` has type `Iterable<C>` but it has no static member `one` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps:
| ....one, // `...` has type `Iterable<C>` but it has no static member `one` | |
| ....one, // `...` yields the context `Iterable` which has no static member `one` |
Elements (including spread elements) don't have a type (they are not expressions), but they contribute to the determination of an element type for a list or set literal, and to a key or value type for a map literal, so it's somewhat confusing to talk about a spread element having a type. Also, ... in itself is even further from having a type. The operand of a spread element does have a context type, and it does have a static namespace which is used for dot shorthand lookups.
|
Thank you! Updated. PTAL. |
eernstg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
2025-05-09 sgrekhov22@gmail.com Fixes dart-lang/co19#3175. Remove forgotten code. (dart-lang/co19#3176) 2025-05-08 sgrekhov22@gmail.com dart-lang/co19#3057. Add test that the list of types of interests always contains `NonNull(declared)`. (dart-lang/co19#3172) 2025-05-07 sgrekhov22@gmail.com Fixes dart-lang/co19#3170. Fix spread collections tests (dart-lang/co19#3171) 2025-05-06 sgrekhov22@gmail.com dart-lang/co19#3057. Add null-aware method invocation tests (dart-lang/co19#3162) 2025-05-05 sgrekhov22@gmail.com dart-lang/co19#3057. Update promotion_via_assignment_A03_t02.dart according to the implementation (dart-lang/co19#3168) Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try Change-Id: I2c91d32c10f7be6050535c735ae15f8798549228 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427721 Commit-Queue: Alexander Thomas <athom@google.com> Reviewed-by: Alexander Thomas <athom@google.com> Reviewed-by: Erik Ernst <eernst@google.com>
No description provided.