-
Notifications
You must be signed in to change notification settings - Fork 28
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
#2641. Add tests for multiple declarations named _
#2656
Conversation
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! I think one location needs to change (it's an unwanted compile-time error), and it would be good to have a bit more on constructors.
Fixed (and some other typos) except constructor tear-offs. Please clarify what is expected? |
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! With some tear-off related test cases, it should be fine!
Added |
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 thing remaining: The testing of constructor tear-offs will not reveal the specific faults that I mentioned, as far as I can see. I wrote a rather long comment about this, PTAL.
Thank you for the details. I updated the test, please take a look. I'm not sure that we can check that arguments were received correctly in case of wildcards. If I misunderstood you, please correct me |
Ah, you're right: The original constructor has parameters whose name is We have a couple of tricky cases where that's not true: class A {
final int _;
A(this._);
} The language team wants to enable this (I'm at most lukewarm on that), and it should initialize the instance variable whose name is However, let's postpone tests about (I don't remember, but if we already have some tests about those things then we should just make sure they don't create any noise, e.g., by causing tools to be changed such that they pass a test that may need to be changed.) Anyway, this is all we can test at this time, so I'll land the PR. |
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
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 (fixed a typo).
Issue about |
No, we don't have such tests yet. They will be added later as test for Initializing formals part of the spec |
Sounds good, thanks! The language team just decided that |
2024-05-16 sgrekhov22@gmail.com dart-lang/co19#2641. Rename `unchanged` -> `other_declarations` (dart-lang/co19#2670) 2024-05-16 sgrekhov22@gmail.com dart-lang/co19#2641. Check that it is still an error to declare more than one class member named `_` (dart-lang/co19#2669) 2024-05-15 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for multiple top-level declarations named `_` (dart-lang/co19#2667) 2024-05-15 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for unchanged type declarations named `_` (dart-lang/co19#2666) 2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for unchanged declarations named `_` (dart-lang/co19#2665) 2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add tests for multiple declarations named `_` (dart-lang/co19#2656) 2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2661. Fix numerous typos in augmented_expression_A01_t09 (dart-lang/co19#2664) 2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2659. Make unique extension members names in augmenting_types_A05_t04 (dart-lang/co19#2662) 2024-05-14 sgrekhov22@gmail.com Fixes dart-lang/co19#2660. Fix typos in augmented_expression_A01_t05 (dart-lang/co19#2663) 2024-05-14 sgrekhov22@gmail.com dart-lang/co19#2641. Add wildcard initializer tests (dart-lang/co19#2658) 2024-05-13 sgrekhov22@gmail.com dart-lang/co19#2119. Remove some accidental comments (dart-lang/co19#2657) Change-Id: I665f56c1039b14354019a32b94183f6d9c9bc5c7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367020 Reviewed-by: Erik Ernst <eernst@google.com> Commit-Queue: Alexander Thomas <athom@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
No description provided.