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 c808b49ec12e0c75d4f42e1d73e1f764bdf345e6..b6aecefafddd634ebadb3be7ca727b94d563c04d 100644 |
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart |
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart |
@@ -1328,6 +1328,29 @@ main() { |
verify([source]); |
} |
+ test_extraPositionalArgumentsCouldBeNamed() async { |
+ Source source = addSource(r''' |
+f({x, y}) {} |
+main() { |
+ f(0, 1, '2'); |
+}'''); |
+ await computeAnalysisResult(source); |
+ assertErrors( |
+ source, [StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED]); |
+ verify([source]); |
+ } |
+ |
+ test_extraPositionalArgumentsCouldBeNamed_functionExpression() async { |
+ Source source = addSource(r''' |
+main() { |
+ (int x, {int y}) {} (0, 1); |
+}'''); |
+ await computeAnalysisResult(source); |
+ assertErrors( |
+ source, [StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED]); |
+ verify([source]); |
+ } |
+ |
test_fieldInitializedInInitializerAndDeclaration_final() async { |
Source source = addSource(r''' |
class A { |
@@ -3062,16 +3085,6 @@ 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'; |
@@ -3120,6 +3133,16 @@ int f(int x) { |
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_staticAccessToInstanceMember_method_invocation() async { |
Source source = addSource(r''' |
class A { |