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!

I suggested a small extension, in order to ensure that name clashes involving superinterfaces is covered as well.

I also noticed something that looks like a duplication of some test cases. I'm not quite sure how much duplication we have (or if there's actually a reason to have both that I didn't see), but PTAL.

// [cfe] unspecified
}

class C5 {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps create a variant?: C5Base could have the instance member and we could have class C5 extends C5Base or class C5 implements C5Base. The point would be to verify that the error is detected also in the case where the instance member isn't in the same lexical scope.

static void set _(int v) {} // Ok
}

class C5 {
Copy link
Member

Choose a reason for hiding this comment

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

Same here: We could change a couple of these cases such that the instance member is in a superinterface.

// ^
// [analyzer] unspecified
// [cfe] unspecified
}
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this a duplicate of something like C5 in LanguageFeatures/Wildcards/unchanged_A05_t06.dart?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps the easiest way to avoid duplicates would be to have instance/static clashes in their own tests (like this one) and omit the instance/static clashes in those other tests (like A05_t06)? I'm not quite sure which approach is easier, but it does look like the current system will generate some duplicates.

(In some cases, e.g., augmenting declarations, it does make sense to test different orderings of elements; but in general we'll just have to assume that it has already been tested "somewhere else" that different textual orderings of declarations will give rise to the same name clash errors, otherwise everything will explode ;-).

@sgrekhov
Copy link
Contributor Author

A very good advices! Thank you! Implemented, PTAL

@sgrekhov sgrekhov requested a review from eernstg May 16, 2024 11:10
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.

Thanks, LGTM!

@eernstg eernstg merged commit 15158f7 into dart-lang:master May 16, 2024
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request May 17, 2024
2024-05-16 [email protected] dart-lang/co19#2641. Rename `unchanged` -> `other_declarations` (dart-lang/co19#2670)
2024-05-16 [email protected] 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 [email protected] dart-lang/co19#2641. Add tests for multiple top-level declarations named `_` (dart-lang/co19#2667)
2024-05-15 [email protected] dart-lang/co19#2641. Add tests for unchanged type declarations named `_` (dart-lang/co19#2666)
2024-05-14 [email protected] dart-lang/co19#2641. Add tests for unchanged declarations named `_` (dart-lang/co19#2665)
2024-05-14 [email protected] dart-lang/co19#2641. Add tests for multiple declarations named `_` (dart-lang/co19#2656)
2024-05-14 [email protected] Fixes dart-lang/co19#2661. Fix numerous typos in augmented_expression_A01_t09 (dart-lang/co19#2664)
2024-05-14 [email protected] Fixes dart-lang/co19#2659. Make unique extension members names in augmenting_types_A05_t04 (dart-lang/co19#2662)
2024-05-14 [email protected] Fixes dart-lang/co19#2660. Fix typos in augmented_expression_A01_t05 (dart-lang/co19#2663)
2024-05-14 [email protected] dart-lang/co19#2641. Add wildcard initializer tests (dart-lang/co19#2658)
2024-05-13 [email protected] 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 <[email protected]>
Commit-Queue: Alexander Thomas <[email protected]>
Reviewed-by: 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