Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: pkg/analyzer/test/src/dart/constant/utilities_test.dart

Issue 1958433002: Do not fail when an enum constant is annotated (issue 26413) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/constant/utilities.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/dart/constant/utilities_test.dart
diff --git a/pkg/analyzer/test/src/dart/constant/utilities_test.dart b/pkg/analyzer/test/src/dart/constant/utilities_test.dart
index a922cf5247f9e534ac518e2c918dd4a80933930d..f4fd958ba676357c556a5e1c5282748028319671 100644
--- a/pkg/analyzer/test/src/dart/constant/utilities_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/utilities_test.dart
@@ -61,6 +61,15 @@ class ConstantFinderTest {
expect(_findAnnotations(), contains(_node));
}
+ void test_visitAnnotation_enumConstant() {
+ // Analyzer ignores annotations on enum constant declarations.
+ Annotation annotation = AstFactory.annotation2(
+ AstFactory.identifier3('A'), null, AstFactory.argumentList());
+ _node = new EnumConstantDeclaration(
+ null, <Annotation>[annotation], AstFactory.identifier3('C'));
+ expect(_findConstants(), isEmpty);
+ }
+
/**
* Test an annotation that represents the invocation of a constant
* constructor.
« no previous file with comments | « pkg/analyzer/lib/src/dart/constant/utilities.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698