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

Unified Diff: pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart

Issue 2886873005: Minor type inference fixes to do with null and bottom types. (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/inference/coerce_bottom_and_null_types.dart
diff --git a/pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart b/pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7189891beece5aa116d8c90162960017c3b0294f
--- /dev/null
+++ b/pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart
@@ -0,0 +1,27 @@
+// 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.
+
+/*@testedFeatures=inference*/
+library test;
+
+f() {
+ var /*@type=int*/ a = 0;
+ var /*@type=dynamic*/ b = null;
+ var /*@type=dynamic*/ c = throw 'foo';
+ var /*@type=() -> int*/ d = /*@returnType=int*/ () => 0;
+ var /*@type=() -> dynamic*/ e = /*@returnType=dynamic*/ () => null;
+ var /*@type=() -> <BottomType>*/ f = /*@returnType=<BottomType>*/ () =>
+ throw 'foo';
+ var /*@type=() -> int*/ g = /*@returnType=int*/ () {
+ return 0;
+ };
+ var /*@type=() -> Null*/ h = /*@returnType=Null*/ () {
+ return null;
+ };
+ var /*@type=() -> <BottomType>*/ i = /*@returnType=<BottomType>*/ () {
+ return (throw 'foo');
+ };
+}
+
+main() {}

Powered by Google App Engine
This is Rietveld 408576698