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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 2667343005: Infer Null for return type of functions with empty returns. (Closed)
Patch Set: Avoid merge conflict Created 3 years, 11 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/analyzer/test/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 73fc16c5d48b058ac12fa345a192ac27da6a7e59..154ed75d4c7d8b71189b33ae6847563e3e27fe21 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -2389,12 +2389,12 @@ void ftf1(void x(int y)) {}
void test_implicitDynamic_return() {
addFile(r'''
// function
-/*error:IMPLICIT_DYNAMIC_RETURN*/f0() {}
+/*error:IMPLICIT_DYNAMIC_RETURN*/f0() {return f0();}
dynamic f1() { return 42; }
// nested function
void main() {
- /*error:IMPLICIT_DYNAMIC_RETURN*/g0() {}
+ /*error:IMPLICIT_DYNAMIC_RETURN*/g0() {return g0();}
dynamic g1() { return 42; }
}
@@ -3246,8 +3246,10 @@ class C<T> {
// Regression test for https://github.com/dart-lang/sdk/issues/26155
checkFile(r'''
void takesF(void f(int x)) {
- takesF(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/([x]) { bool z = x.isEven; });
- takesF(/*info:INFERRED_TYPE_CLOSURE*/(y) { bool z = y.isEven; });
+ takesF(/*info:INFERRED_TYPE_CLOSURE,
+ info:INFERRED_TYPE_CLOSURE*/([x]) { bool z = x.isEven; });
+ takesF(/*info:INFERRED_TYPE_CLOSURE,
+ info:INFERRED_TYPE_CLOSURE*/(y) { bool z = y.isEven; });
}
''');
}

Powered by Google App Engine
This is Rietveld 408576698