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

Unified Diff: test/codegen/lib/mirrors/regress_14304_test.dart

Issue 2265533002: Add mirrors tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 4 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
Index: test/codegen/lib/mirrors/regress_14304_test.dart
diff --git a/test/codegen/language/closure_type_variable_test.dart b/test/codegen/lib/mirrors/regress_14304_test.dart
similarity index 55%
copy from test/codegen/language/closure_type_variable_test.dart
copy to test/codegen/lib/mirrors/regress_14304_test.dart
index 2ed61c27ccfaa6d4cd178ca2e9d408bf55f26c96..af974a40fb5f82d4b7c83a66893d8bfa9d09a69e 100644
--- a/test/codegen/language/closure_type_variable_test.dart
+++ b/test/codegen/lib/mirrors/regress_14304_test.dart
@@ -2,17 +2,19 @@
// 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.
-// Test that the type argument is available inside a closure.
+// Regression test for Issue 14304.
+import "dart:mirrors";
import "package:expect/expect.dart";
class A<T> {
- foo() {
- bar() => T;
- return bar();
- }
+ T m() {}
}
main() {
- Expect.equals(new A<int>().foo(), int);
-}
+ ClassMirror a = reflectClass(A);
+ TypeVariableMirror t = a.typeVariables[0];
+ MethodMirror m = a.declarations[#m];
+
+ Expect.equals(t, m.returnType);
+}

Powered by Google App Engine
This is Rietveld 408576698