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

Unified Diff: pkg/analyzer/test/src/dart/analysis/driver_test.dart

Issue 2565173008: Fix for resynthesizing invalid @functionName() annotations. (Closed)
Patch Set: Created 4 years 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
Index: pkg/analyzer/test/src/dart/analysis/driver_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index 846ebbe721c6641b7709f0a6b5d72ed47413a309..c413e23056f0e09f9438dbfc4ad6f56784f9ba34 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -653,6 +653,23 @@ class B extends A {
expect(_getClassMethodReturnType(result.unit, 'B', 'm'), 'int');
}
+ test_getResult_invalid_annotation_functionAsConstructor() async {
+ addTestFile(
+ r'''
+fff() {}
+
+@fff()
+class C {}
+''',
+ priority: true);
+
+ AnalysisResult result = await driver.getResult(testFile);
+ ClassDeclaration c = result.unit.declarations[1] as ClassDeclaration;
+ Annotation a = c.metadata[0];
+ expect(a.name.name, 'fff');
+ expect(a.name.staticElement, new isInstanceOf<FunctionElement>());
+ }
+
test_getResult_invalidUri_exports_dart() async {
String content = r'''
export 'dart:async';
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698