| Index: pkg/analyzer/test/src/task/dart_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
|
| index 8df7837761dbc8c2d45e098050900d515f32fbf0..9215145dae8e44e23ab4766f1f23d3376ee616a5 100644
|
| --- a/pkg/analyzer/test/src/task/dart_test.dart
|
| +++ b/pkg/analyzer/test/src/task/dart_test.dart
|
| @@ -1145,6 +1145,33 @@ class D { const D(value); }
|
| outputs[CONSTANT_DEPENDENCIES].toSet(), [x, constructorForD].toSet());
|
| }
|
|
|
| + test_annotation_with_nonConstArg() {
|
| + Source source = newSource(
|
| + '/test.dart',
|
| + '''
|
| +class A {
|
| + const A(x);
|
| +}
|
| +class C {
|
| + @A(const [(_) => null])
|
| + String s;
|
| +}
|
| +''');
|
| + // First compute the resolved unit for the source.
|
| + LibrarySpecificUnit librarySpecificUnit =
|
| + new LibrarySpecificUnit(source, source);
|
| + computeResult(librarySpecificUnit, RESOLVED_UNIT1);
|
| + CompilationUnit unit = outputs[RESOLVED_UNIT1];
|
| + // Find the annotation on the field.
|
| + ClassDeclaration classC = unit.declarations[1];
|
| + Annotation annotation = classC.members[0].metadata[0];
|
| + // Now compute the dependencies for the annotation, and check that it is
|
| + // the right size.
|
| + computeResult(annotation.elementAnnotation, CONSTANT_DEPENDENCIES,
|
| + matcher: isComputeConstantDependenciesTask);
|
| + expect(outputs[CONSTANT_DEPENDENCIES], hasLength(1));
|
| + }
|
| +
|
| test_annotation_without_args() {
|
| Source source = newSource(
|
| '/test.dart',
|
|
|