File tree 1 file changed +19
-0
lines changed
pkg/analysis_server/test/analysis 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,25 @@ void f() {
427
427
ParameterInfo (ParameterKind .REQUIRED_POSITIONAL , 'length' , 'int' )));
428
428
}
429
429
430
+ Future <void > test_function_wildcardParams () async {
431
+ newFile (testFilePath, '''
432
+ void g(int _, [String _]) {}
433
+ void f() {
434
+ g(/*^*/);
435
+ }
436
+ ''' );
437
+ var result = await prepareSignature ('/*^*/' );
438
+ expect (result.name, equals ('g' ));
439
+ expect (result.parameters, hasLength (2 ));
440
+ // Ensure wildcard params have their types.
441
+ expect (result.parameters[0 ],
442
+ equals (ParameterInfo (ParameterKind .REQUIRED_POSITIONAL , '_' , 'int' )));
443
+ expect (
444
+ result.parameters[1 ],
445
+ equals (
446
+ ParameterInfo (ParameterKind .OPTIONAL_POSITIONAL , '_' , 'String' )));
447
+ }
448
+
430
449
Future <void > test_function_zero_arguments () async {
431
450
newFile (testFilePath, '''
432
451
/// one doc
You can’t perform that action at this time.
0 commit comments