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

Unified Diff: pkg/front_end/testcases/function_type_is_check.dart

Issue 2899693003: Fix crash with generalized function types in type tests. (Closed)
Patch Set: Created 3 years, 7 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: pkg/front_end/testcases/function_type_is_check.dart
diff --git a/pkg/front_end/testcases/function_type_is_check.dart b/pkg/front_end/testcases/function_type_is_check.dart
new file mode 100644
index 0000000000000000000000000000000000000000..706ac9e351257691c67e6f0f8f611a469480688b
--- /dev/null
+++ b/pkg/front_end/testcases/function_type_is_check.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2017, 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" show Expect;
+
+test(f) {
+ if (f is void Function(Object, StackTrace)) return 1;
+ if (f is void Function(Object)) return 10;
+ if (f is void Function()) return 100;
+}
+
+main() {
+ Expect.equals(
+ 111,
+ test(() => null) +
+ test((Object o) => null) +
+ test((Object o, StackTrace t) => null));
+}

Powered by Google App Engine
This is Rietveld 408576698