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

Unified Diff: tests/language/function_type3_test.dart

Issue 923113002: dart2js: fix dart2js crash when getRuntimeTypeArgument was not registered. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/function_type3_test.dart
diff --git a/tests/language/function_type3_test.dart b/tests/language/function_type3_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..809a43944989b4f5d623e7e8bd7a6ee6b406ae9a
--- /dev/null
+++ b/tests/language/function_type3_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2015, 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.
+
+import "package:expect/expect.dart";
+
+class A<T> {
+ @NoInlining()
+ A();
+
+ @NoInlining()
+ foo() => new B<T>();
+}
+
+class B<T> {
+ T bar() => null;
+}
+
+typedef F();
+typedef F2(x);
+
+// Dart2js realized that the generic type for A was not needed, but then used
+// it nevertheless when it constructed the closure.
+main() {
+ var f = new A<int>().foo().bar;
+ Expect.isTrue(f is F);
+ Expect.isFalse(f is F2);
+}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698