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

Unified Diff: tests/language/closure_type_variable_test.dart

Issue 13527003: Make `this` available in closures if a type variable is used as expression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add null check and test status for dart2dart Created 7 years, 9 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 | « sdk/lib/_internal/compiler/implementation/closure.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/closure_type_variable_test.dart
diff --git a/tests/language/generic_is_check_test.dart b/tests/language/closure_type_variable_test.dart
similarity index 61%
copy from tests/language/generic_is_check_test.dart
copy to tests/language/closure_type_variable_test.dart
index 4e13c1f32e1720dd8c1fddf3daa52c43fca625c5..4f73267c7d8af37ade37f559fdade6c550d3e8dc 100644
--- a/tests/language/generic_is_check_test.dart
+++ b/tests/language/closure_type_variable_test.dart
@@ -2,12 +2,15 @@
// 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.
+
class A<T> {
- foo() => this is A<int>;
+ foo() {
+ bar() => T;
+ return bar();
+ }
}
main() {
- Expect.isTrue(new A().foo());
- Expect.isTrue(new A<int>().foo());
- Expect.isFalse(new A<String>().foo());
+ Expect.equals(new A<int>().foo(), int);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/closure.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698