Skip to content
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

co19/LanguageFeatures/Augmentation-libraries/augmenting_types_A05_t04 #2659

Closed
scheglov opened this issue May 13, 2024 · 1 comment
Closed
Assignees
Labels
bad-test Report tests in need of updates. When closed, the tests should be considered good

Comments

@scheglov
Copy link

typedef AAlias = A;
<cut>
extension Ext1<T extends A> on D<T> {}
extension Ext2<T extends AAlias> on D<T> {}

and augmentations

augment extension Ext1<T extends A> {
  String get name1 => 'Ext1<$T>';
}
augment extension Ext1<T extends AAlias> {
  String name2() => 'Ext1<$T>';
}
augment extension Ext2<T extends A> {
  String get name1 => 'Ext2<$T>';
}
augment extension Ext2<T extends AAlias> {
  String name2() => 'Ext2<$T>';
}

With (not yet landed) fix to look at all extension members this gives, see below.

Which look as correct errors to me.
extension Ext2<T extends AAlias> on D<T> is the same as extension Ext1<T extends A> on D<T>.

unexpected analysis errors in augmenting_types_A05_t04.dart:
- Line 74, column 35: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name1' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

- Line 75, column 35: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name2' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

- Line 76, column 40: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name1' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

- Line 77, column 40: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name2' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

- Line 78, column 35: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name1' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

- Line 79, column 35: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name2' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

- Line 80, column 40: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name1' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

- Line 81, column 40: COMPILE_TIME_ERROR.AMBIGUOUS_EXTENSION_MEMBER_ACCESS
  A member named 'name2' is defined in extension 'Ext1' and extension 'Ext2', and none are more specific.

--- Re-run this test:
python3 tools/test.py -m release -c dart2analyzer -a arm64 co19/LanguageFeatures/Augmentation-libraries/augmenting_types_A05_t04
@eernstg
Copy link
Member

eernstg commented May 13, 2024

Right, it's a strong hint that we expect the following:

void main() {
  ...
  Expect.equals("Ext1<B>", D<B>().name1);
  ...
  Expect.equals("Ext2<B>", D<B>().name1);
  ...
}

I guess the names could just be something like name11 and name12 in Ext1 and name21 and name22 in Ext2.

@sgrekhov sgrekhov self-assigned this May 14, 2024
@sgrekhov sgrekhov added the bad-test Report tests in need of updates. When closed, the tests should be considered good label May 14, 2024
sgrekhov added a commit to sgrekhov/co19 that referenced this issue May 14, 2024
sgrekhov added a commit to sgrekhov/co19 that referenced this issue May 14, 2024
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue May 17, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad-test Report tests in need of updates. When closed, the tests should be considered good
Projects
None yet
Development

No branches or pull requests

3 participants