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

Unified Diff: pkg/analyzer/test/generated/static_warning_code_test.dart

Issue 2752423003: Restore weak mode errors on empty returns in Null functions (Closed)
Patch Set: Created 3 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: pkg/analyzer/test/generated/static_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index c196f21897e7e4aed6b5a712e816bed2a54622a3..c808b49ec12e0c75d4f42e1d73e1f764bdf345e6 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -3062,6 +3062,16 @@ class B {
verify([source]);
}
+ test_returnWithoutValue_Null() async {
+ // Test that block bodied functions with return type Null and an empty
+ // return cause a static warning.
+ Source source = addSource(r'''
+Null f() {return;}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [StaticWarningCode.RETURN_WITHOUT_VALUE]);
+ }
+
test_returnWithoutValue_async() async {
Source source = addSource('''
import 'dart:async';
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/test/generated/strong_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698