Skip to content

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

Merged
merged 2 commits into from
May 28, 2024

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!

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
Copy link
Member

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?

@sgrekhov
Copy link
Contributor Author

Thank you. Updated, PTAL

@sgrekhov sgrekhov requested a review from eernstg May 28, 2024 11:26
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 c0273e0 into dart-lang:master May 28, 2024
2 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Jun 3, 2024
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]>
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