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

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

Issue 24019007: Fix reparsing of function parameters that include type parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « runtime/vm/parser.cc ('k') | tests/lib/mirrors/stringify.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/parameter_test.dart
diff --git a/tests/lib/mirrors/parameter_test.dart b/tests/lib/mirrors/parameter_test.dart
index 7c538a773bf4b489e26420c77237b94aa0218a0c..6a86c534fbdbcf401f0ff8daf0304fdf18b882a3 100644
--- a/tests/lib/mirrors/parameter_test.dart
+++ b/tests/lib/mirrors/parameter_test.dart
@@ -31,6 +31,12 @@ class B {
waldo(int z);
}
+class C <S extends int, T> {
+ // TODO(6490): Currently only supported by the VM.
+ foo(int a, S b) => b;
+ bar(S a, T b, num c) {}
+}
+
main() {
ClassMirror cm = reflectClass(B);
Map<Symbol, MethodMirror> constructors = cm.constructors;
@@ -141,4 +147,27 @@ main() {
' type = Class(s(int) in s(dart.core), top-level))]',
waldo.parameters);
expect('<null>', waldo.parameters[0].defaultValue);
+
+ cm = reflectClass(C);
+
+ MethodMirror fooInC = cm.members[const Symbol("foo")];
+ expect('Method(s(foo) in s(C))', fooInC);
+ expect('[Parameter(s(a) in s(foo),'
+ ' type = Class(s(int) in s(dart.core), top-level)), '
+ 'Parameter(s(b) in s(foo),'
+ ' type = TypeVariable(s(S) in s(C),'
+ ' upperBound = Class(s(int) in s(dart.core), top-level)))]',
+ fooInC.parameters);
+
+ MethodMirror barInC = cm.members[const Symbol("bar")];
+ expect('Method(s(bar) in s(C))', barInC);
+ expect('[Parameter(s(a) in s(bar),'
+ ' type = TypeVariable(s(S) in s(C),'
+ ' upperBound = Class(s(int) in s(dart.core), top-level))), '
+ 'Parameter(s(b) in s(bar),'
+ ' type = TypeVariable(s(T) in s(C),'
+ ' upperBound = Class(s(Object) in s(dart.core), top-level))), '
+ 'Parameter(s(c) in s(bar),'
+ ' type = Class(s(num) in s(dart.core), top-level))]',
+ barInC.parameters);
}
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/lib/mirrors/stringify.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698