File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
pkg/analysis_server/test/services/refactoring/agnostic Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1967,6 +1967,38 @@ ChangeStatusFailure
1967
1967
''' );
1968
1968
}
1969
1969
1970
+ Future <void > test_topFunction_functionTypedFormalParameter () async {
1971
+ await _analyzeValidSelection (r'''
1972
+ void ^test(int a()) {}
1973
+
1974
+ void f() {
1975
+ test(() => 0);
1976
+ }
1977
+ ''' );
1978
+
1979
+ final signatureUpdate = MethodSignatureUpdate (
1980
+ formalParameters: [
1981
+ FormalParameterUpdate (
1982
+ id: 0 ,
1983
+ kind: FormalParameterKind .requiredNamed,
1984
+ ),
1985
+ ],
1986
+ formalParametersTrailingComma: TrailingComma .always,
1987
+ argumentsTrailingComma: ArgumentsTrailingComma .ifPresent,
1988
+ );
1989
+
1990
+ await _assertUpdate (signatureUpdate, r'''
1991
+ >>>>>>> /home/test/lib/test.dart
1992
+ void test({
1993
+ required int a(),
1994
+ }) {}
1995
+
1996
+ void f() {
1997
+ test(a: () => 0);
1998
+ }
1999
+ ''' );
2000
+ }
2001
+
1970
2002
Future <void > test_topFunction_multipleFiles () async {
1971
2003
newFile ('$testPackageLibPath /a.dart' , r'''
1972
2004
import 'test.dart';
You can’t perform that action at this time.
0 commit comments