Files
sdk/pkg/front_end/parser_testcases/augmentation/augment_super.dart
T
Johnni Winther 36607d877a [parser] Support 'augment super' as its own expression
This adds support for parsing `argument super` as its own expression
in augmentation libraries. This is not handled (correctly) by the
ast builders of analyzer and cfe yet.

Change-Id: Ibe67ad9daf56c82e8ec94f16d468e6b0d8f84d22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244922
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-05-20 09:36:52 +00:00

53 lines
904 B
Dart

augment void topLevelMethod() {
augment super();
}
augment void topLevelMethodError() {
augment int local;
augment;
}
augment List<int> get topLevelProperty {
return [... augment super, augment super[0]];
}
augment void set topLevelProperty(List<int> value) {
augment super[0] = value[1];
augment super = value;
}
void injectedTopLevelMethod() {
augment super();
augment super;
augment int local;
augment;
}
augment class Class {
augment void instanceMethod() {
augment super();
}
augment void instanceMethodErrors() {
augment int local;
augment;
}
augment int get instanceProperty {
augment super++;
--augment super;
return -augment super;
}
augment void set instanceProperty(int value) {
augment super = value;
}
void injectedInstanceMethod() {
augment super();
augment super;
augment int local;
augment;
}
}