mirror of
https://github.com/dart-lang/sdk
synced 2024-10-07 16:19:50 +00:00
bulk fix for avoid_types_on_closure_parameters
Change-Id: Id080559bc2a18fd8ce4c8eb59412c4461d8dac39 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156340 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
parent
b4a7c68989
commit
e12a536edb
|
@ -41,6 +41,8 @@ class BulkFixProcessor {
|
|||
LintNames.avoid_return_types_on_setters: RemoveTypeAnnotation.newInstance,
|
||||
LintNames.avoid_single_cascade_in_expression_statements:
|
||||
ReplaceCascadeWithDot.newInstance,
|
||||
LintNames.avoid_types_on_closure_parameters:
|
||||
RemoveTypeAnnotation.newInstance,
|
||||
LintNames.prefer_contains: ConvertToContains.newInstance,
|
||||
LintNames.prefer_equal_for_default_values:
|
||||
ReplaceColonWithEquals.newInstance,
|
||||
|
|
|
@ -11,6 +11,7 @@ void main() {
|
|||
defineReflectiveSuite(() {
|
||||
defineReflectiveTests(RemoveDynamicTypeAnnotationTest);
|
||||
defineReflectiveTests(RemoveSetterReturnTypeAnnotationTest);
|
||||
defineReflectiveTests(RemoveTypeAnnotationOnClosureParamsTest);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -57,3 +58,20 @@ set s2(int s2) {}
|
|||
''');
|
||||
}
|
||||
}
|
||||
|
||||
@reflectiveTest
|
||||
class RemoveTypeAnnotationOnClosureParamsTest extends BulkFixProcessorTest {
|
||||
@override
|
||||
String get lintCode => LintNames.avoid_types_on_closure_parameters;
|
||||
|
||||
Future<void> test_singleFile() async {
|
||||
await resolveTestUnit('''
|
||||
var x = ({Future<int> defaultValue}) => null;
|
||||
var y = (Future<int> defaultValue) => null;
|
||||
''');
|
||||
await assertHasFix('''
|
||||
var x = ({defaultValue}) => null;
|
||||
var y = (defaultValue) => null;
|
||||
''');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue