Files
sdk/pkg/front_end/testcases/late_lowering/late_annotations.dart
T
Johnni Winther 585d664d35 [cfe] Add annotations on synthesized getters/setters
This moves late lowered annotations from the field declaration to the
synthesized getters and setters, and adds annotations to the synthesized
setter for external fields.

Change-Id: I50e6cb9e155877a2be4d92ea2d9c9dc7796fef8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148521
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-19 11:18:30 +00:00

76 lines
1.5 KiB
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
class Annotation {
const Annotation();
}
@Annotation()
late int topLevelField;
@Annotation()
late final int finalTopLevelField;
@Annotation()
late final int finalTopLevelFieldWithInitializer = 0;
class A {
@Annotation()
late int instanceField;
@Annotation()
late final int finalInstanceField;
@Annotation()
late final int finalInstanceFieldWithInitializer = 0;
@Annotation()
covariant late num covariantInstanceField;
@Annotation()
static late int staticField;
@Annotation()
static late final int finalStaticField;
@Annotation()
static late final int finalStaticFieldWithInitializer = 0;
}
mixin B {
@Annotation()
late int instanceField;
@Annotation()
late final int finalInstanceField;
@Annotation()
late final int finalInstanceFieldWithInitializer = 0;
@Annotation()
covariant late num covariantInstanceField;
@Annotation()
static late int staticField;
@Annotation()
static late final int finalStaticField;
@Annotation()
static late final int finalStaticFieldWithInitializer = 0;
}
extension Extension on A {
@Annotation()
static late int extensionStaticField;
@Annotation()
static late final int finalExtensionStaticField;
@Annotation()
static late final int finalExtensionStaticFieldWithInitializer = 0;
}
main() {}