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

Unified Diff: tests/lib/mirrors/mirrors_used_generic_types_test.dart

Issue 2615943004: Reapply "reflectType() dynamic type arguments support (#26012)" (Closed)
Patch Set: Add a test. Created 3 years, 11 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 | « tests/lib/lib.status ('k') | tests/lib/mirrors/reflected_type_generics_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/mirrors_used_generic_types_test.dart
diff --git a/tests/lib/mirrors/mirrors_used_generic_types_test.dart b/tests/lib/mirrors/mirrors_used_generic_types_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..59622149ac241e1d4c091e3234d9ebe735a840b5
--- /dev/null
+++ b/tests/lib/mirrors/mirrors_used_generic_types_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2017, 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.
+
+library Test;
+
+@MirrorsUsed(targets: const ["Test"])
+import 'dart:mirrors';
+import 'dart:async';
+
+import 'package:expect/expect.dart';
+
+class A {
+ // Because of the `mirrors-used` annotation, the types `List` and `Future`
+ // are not reflectable.
+ // However, we still need to be able to create a Mirror for them, when we
+ // create a mirror for `foo`. In particular, it must be able to create a
+ // mirror, even though there are generic types.
+ List<int> foo(Future<int> x) {
+ return null;
+ }
+}
+
+void main() {
+ var m = reflect(new A()).type.instanceMembers[#foo];
+ Expect.equals(#List, m.returnType.simpleName);
+ Expect.equals(#Future, m.parameters[0].type.simpleName);
+}
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/reflected_type_generics_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698