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

Unified Diff: tests/language/instance_creation_in_function_annotation_test.dart

Issue 1125613003: Make sure to visit function annotations in ElementBuilder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/test/generated/non_error_resolver_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/instance_creation_in_function_annotation_test.dart
diff --git a/tests/language/instance_creation_in_function_annotation_test.dart b/tests/language/instance_creation_in_function_annotation_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..804cb97f873a5900fce4d609483d6c01a19eb5dd
--- /dev/null
+++ b/tests/language/instance_creation_in_function_annotation_test.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2015, 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.
+
+// Verify that instance creation expressions inside function
+// annotations are properly handled. See dartbug.com/23354
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+
+class C {
+ final String s;
+ const C(this.s);
+}
+
+class D {
+ final C c;
+ const D(this.c);
+}
+
+@D(const C('foo'))
+f() {}
+
+main() {
+ ClosureMirror closureMirror = reflect(f);
+ List<InstanceMirror> metadata = closureMirror.function.metadata;
+ Expect.equals(1, metadata.length);
+ Expect.equals(metadata[0].reflectee.c.s, 'foo');
+}
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698