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

Unified Diff: tests/language/type_variable_closure_test.dart

Issue 17262003: Fix type variables in closures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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: tests/language/type_variable_closure_test.dart
diff --git a/tests/language/call_argument_inference_test.dart b/tests/language/type_variable_closure_test.dart
similarity index 65%
copy from tests/language/call_argument_inference_test.dart
copy to tests/language/type_variable_closure_test.dart
index 0af5537d58ddb8eacad9f37bbbb5e0adc8295f3c..22560710e61d244c0241f5b1a91aec52cc57d877 100644
--- a/tests/language/call_argument_inference_test.dart
+++ b/tests/language/type_variable_closure_test.dart
@@ -4,11 +4,14 @@
import "package:expect/expect.dart";
-class A {
- call(a) => a is num;
+class C<T> {
+ C.foo() {
+ x = (a) => a is T;
+ }
+ var x;
}
main() {
- Expect.isTrue(new A().call(42));
- Expect.isFalse(new A()('foo'));
+ Expect.isTrue(new C<int>.foo().x(1));
+ Expect.isFalse(new C<int>.foo().x('1'));
}

Powered by Google App Engine
This is Rietveld 408576698