-
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
[augmentation-libraries] Cover success case for aliased augmenting declarations #2574
Comments
2024-04-04 sgrekhov22@gmail.com Fixes dart-lang/co19#2589. Fix roll failure (dart-lang/co19#2590) 2024-04-03 sgrekhov22@gmail.com dart-lang/co19#2559. Add more augmenting types tests. Augment extends (dart-lang/co19#2588) 2024-04-03 sgrekhov22@gmail.com dart-lang/co19#2559. Rename and regroup augmentation types tests (dart-lang/co19#2587) 2024-04-02 sgrekhov22@gmail.com dart-lang/co19#2559. Add augmenting types tests. Part 5 (dart-lang/co19#2582) 2024-04-02 sgrekhov22@gmail.com dart-lang/co19#2559. Update augmenting libraries tests according dart-lang/co19#2583 (dart-lang/co19#2586) 2024-04-02 sgrekhov22@gmail.com Fixes dart-lang/co19#2574. Add more augmenting types tests (dart-lang/co19#2581) 2024-04-02 sgrekhov22@gmail.com dart-lang/co19#2559. Add augmenting types tests. Part 6 (dart-lang/co19#2583) 2024-04-01 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/co19#2585) 2024-04-01 49699333+dependabot[bot]@users.noreply.github.com Bump actions/setup-java from 4.1.0 to 4.2.1 (dart-lang/co19#2584) 2024-03-27 sgrekhov22@gmail.com Fixes dart-lang/co19#2577. Add more chained patterns assignment tests (dart-lang/co19#2580) 2024-03-26 sgrekhov22@gmail.com Fixes dart-lang/co19#2575. Remove null-aware warnings for CFE (dart-lang/co19#2578) 2024-03-26 sgrekhov22@gmail.com Fixes dart-lang/co19#2576. Replace `library augment` by `augment library` (dart-lang/co19#2579) 2024-03-25 sgrekhov22@gmail.com dart-lang/co19#2559. Add augmenting types tests. Part 2 (dart-lang/co19#2569) R=brianwilkerson@google.com, vegorov@google.com Change-Id: Ibf64d7fdcae0044b7317718ecf7e0852e0983f7d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361161 Reviewed-by: Erik Ernst <eernst@google.com> Auto-Submit: Sergey Grekhov <sgrekhov22@gmail.com> Reviewed-by: Alexander Thomas <athom@google.com>
Where the fact that type aliases can be used is described in the specification? |
Ah, you're right, @scheglov, it is not supported that an augmenting declaration can use a type alias to refer to the augmented declaration. So this should be an error: // --- Library 'main.dart'.
import augment 'augment.dart';
class B {}
class C {}
typedef CAlias = C;
// --- Library augmentation 'augment.dart'.
augment library 'main.dart';
augment class CAlias implements B {} @sgrekhov, this implies that the tests introduced by #2581 need to be adjusted to expect errors: It is an error to This also implies that the meaning of the tests added in #2568, in particular LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t02.dart and its augmentations, is different from what I was considering when reviewing them. (So |
Reopened |
Interesting. @eernstg specification contains the following syntax
What exactly can be augmented here? Could you show any useful example? We cannot change |
Ah, it's for adding metadata and DocComments. Ok |
It is not unthinkable that a type alias augmentation could do something which is similar to variable declarations: typedef F<X> = List<X>;
augment typedef F<X> = Map<augmented<X>, augmented<X>>; // means `Map<List<X>, List<X>>`. I wouldn't recommend it, though. 😄 So let's stick to the DartDoc comments and metadata. |
2024-05-03 sgrekhov22@gmail.com Fixes dart-lang/co19#2635. Use null-aware operator to invoke function via nullable variable (dart-lang/co19#2636) 2024-05-02 sgrekhov22@gmail.com dart-lang/co19#2559. Add more augmented expression tests for local variables in field initializers (dart-lang/co19#2634) 2024-05-02 sgrekhov22@gmail.com dart-lang/co19#2559. Add more augmented expression tests for local variables inside of getters and setters (dart-lang/co19#2633) 2024-05-02 sgrekhov22@gmail.com dart-lang/co19#2559. Add augmented expression tests for functions (dart-lang/co19#2630) 2024-05-01 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.2 to 4.1.4 (dart-lang/co19#2632) 2024-05-01 sgrekhov22@gmail.com dart-lang/co19#2559. Make more augmented expression tests stronger (dart-lang/co19#2629) 2024-05-01 sgrekhov22@gmail.com Fixes dart-lang/co19#2574. Expect an error in case of augmenting a type alias (dart-lang/co19#2627) 2024-04-30 sgrekhov22@gmail.com dart-lang/co19#2559. Add augmenting expression tests for fields with no initializers (dart-lang/co19#2626) 2024-04-30 sgrekhov22@gmail.com dart-lang/co19#2559. Make augmented expression tests stronger (dart-lang/co19#2628) 2024-04-29 sgrekhov22@gmail.com Fixes dart-lang/co19#2624. Add more extension type tests for union types (dart-lang/co19#2625) 2024-04-26 sgrekhov22@gmail.com dart-lang/co19#2559. Add augmenting expression tests for fields (dart-lang/co19#2621) Change-Id: I8246f841afd24390742ba225e769ba881dccef9b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365261 Reviewed-by: Alexander Thomas <athom@google.com> Commit-Queue: Erik Ernst <eernst@google.com> Reviewed-by: Erik Ernst <eernst@google.com>
PR #2568 contains a test LanguageFeatures/Augmentation-libraries/augmenting_types_A01_t02.dart checking that we get the expected compile-time errors in the case where a type alias of a type declaration of a mismatched kind is augmented.
Do we have a test which is testing the same situation, except that the type aliases denote types of the same kind? (That is, the case where we should not get an error because there is no kind mismatch, but there might still be an error because a tool mistakenly treats the type alias as a new and different kind and fails to see that the type alias denotes a declaration of the right kind).
The text was updated successfully, but these errors were encountered: