Index: pkg/analysis_server/test/services/correction/fix_test.dart |
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart |
index b1a00cd2a150b713d281e6643c785b859d438344..086fe94ad247091188c195a2ded39944886157fc 100644 |
--- a/pkg/analysis_server/test/services/correction/fix_test.dart |
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart |
@@ -727,6 +727,24 @@ int test(double a, String b) { |
'''); |
} |
+ void test_creationFunction_forFunctionType_coreFunction() { |
+ _indexTestUnit(''' |
+main() { |
+ useFunction(g: test); |
+} |
+useFunction({Function g}) {} |
+'''); |
+ assertHasFix(FixKind.CREATE_FUNCTION, ''' |
+main() { |
+ useFunction(g: test); |
+} |
+useFunction({Function g}) {} |
+ |
+test() { |
+} |
+'''); |
+ } |
+ |
void test_creationFunction_forFunctionType_dynamicArgument() { |
_indexTestUnit(''' |
main() { |
@@ -763,6 +781,24 @@ int test(double a, String b) { |
'''); |
} |
+ void test_creationFunction_forFunctionType_function_namedArgument() { |
+ _indexTestUnit(''' |
+main() { |
+ useFunction(g: test); |
+} |
+useFunction({int g(double a, String b)}) {} |
+'''); |
+ assertHasFix(FixKind.CREATE_FUNCTION, ''' |
+main() { |
+ useFunction(g: test); |
+} |
+useFunction({int g(double a, String b)}) {} |
+ |
+int test(double a, String b) { |
+} |
+'''); |
+ } |
+ |
void test_creationFunction_forFunctionType_method_enclosingClass_static() { |
_indexTestUnit(''' |
class A { |