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

Unified Diff: tests/language/function_type_alias8_test.dart

Issue 13046009: Fix issue 9442. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
Index: tests/language/function_type_alias8_test.dart
===================================================================
--- tests/language/function_type_alias8_test.dart (revision 0)
+++ tests/language/function_type_alias8_test.dart (revision 0)
@@ -0,0 +1,51 @@
+// Copyright (c) 2013, 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.
+
+// Regression test for issue 9442.
+typedef dynamic GetFromThing<T extends Thing>(T target);
+
+typedef GetFromThing<T> DefGetFromThing<T extends Thing>(dynamic def);
+
+typedef dynamic GetFromT<T>(T target);
+
+typedef GetFromT<T> DefGetFromT<T>(dynamic def);
+
+class Thing {
+ int value;
+}
+
+class Test {
+
+ static final GetFromThing<Thing> fromThingSimple = (Thing target) {
+ return target.value;
+ };
+
+ static final DefGetFromThing<Thing> fromThing = (dynamic def) {
+ return (target) => null;
+ };
+
+ static final DefGetFromT<int> fromInt = (dynamic def) {
+ return (target) => null;
+ };
+
+}
+
+test(msg, fun) {
+ fun();
+}
+
+main() {
+ test('this works', () {
+ var temp1 = Test.fromThingSimple(new Thing());
srdjan 2013/03/26 21:05:34 remove var temp1
+ });
+
+ test('this works too', () {
+ var temp = Test.fromInt(10);
srdjan 2013/03/26 21:05:34 remove "var temp"
+ });
+
+ test('should let me call lexically closed functions', () {
+ var temp = Test.fromThing(10); // <-- causes test to hang
srdjan 2013/03/26 21:05:34 Remove comment.
+ });
+}
+

Powered by Google App Engine
This is Rietveld 408576698