-
Notifications
You must be signed in to change notification settings - Fork 28
Fixes #2689. Add more extension methods tests #2690
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
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'm suggesting an adjustment of a test where 'basename' is mentioned, because it doesn't actually use anything that differs from the plain names.
Another thing could be slightly confusing: Several description paragraphs talk about "it is not an error" and then something about the existence of declarations in extensions. However, that's never an error, because we don't have name clashes among separate extension declarations as such.
The situation where we may get an error is when there is a call site whose resolution fails, because there are multiple accessible and applicable extensions with an extension instance member whose basename is the same as the basename of the invocation.
So, in order to avoid the confusion, it could be safer to say something like "it does not give rise to an ambiguity error at the call site" rather than "it is not an error". I'm sure there's a more elegant way to say this, but the point is just that we shouldn't imply that there is an error in one or the other extension, it's all about errors at the call site.
/// instantiate-to-bounds type of [T2] and not vice versa. | ||
/// | ||
/// @description Check that it is not an error if two extensions add static and | ||
/// instance members with the same basename |
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.
The basename is just the name unless the member is a setter. So perhaps change the getters to setters? And also cover static method vs. instance setter?
Thank you. Updated, PTAL |
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!
2024-05-30 [email protected] dart-lang/co19#2641. Add super parameters tests (dart-lang/co19#2687) 2024-05-29 [email protected] Fixes dart-lang/co19#2678. Add more extension types static vs instance conflict tests (dart-lang/co19#2692) 2024-05-29 [email protected] Fixes dart-lang/co19#2668. Reorder switch expressions to avoid flow analysis secondary issues (dart-lang/co19#2693) 2024-05-28 [email protected] dart-lang/co19#2641. Add external functions and covariant parameters tests (dart-lang/co19#2691) 2024-05-28 [email protected] Fixes dart-lang/co19#2689. Add more extension methods tests (dart-lang/co19#2690) 2024-05-27 [email protected] dart-lang/co19#2641. Add extension types tests (dart-lang/co19#2688) [email protected] Change-Id: Ie5c551e3198e748b55d45ec5039d1ff836444ee2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369000 Auto-Submit: Sergey Grekhov <[email protected]> Reviewed-by: Alexander Thomas <[email protected]> Reviewed-by: Erik Ernst <[email protected]> Commit-Queue: Alexander Thomas <[email protected]>
No description provided.