Enable strict_top_level_inference (#160674)
Only observation: It forces a type on `_` parameters.
This commit is contained in:
parent
d9e5a5c21d
commit
7df127b1ee
@ -8,7 +8,7 @@
|
|||||||
# which should be kept in sync with this file:
|
# which should be kept in sync with this file:
|
||||||
#
|
#
|
||||||
# - analysis_options.yaml (this file)
|
# - analysis_options.yaml (this file)
|
||||||
# - https://github.com/flutter/engine/blob/main/analysis_options.yaml
|
# - engine/src/flutter/analysis_options.yaml
|
||||||
# - https://github.com/flutter/packages/blob/main/analysis_options.yaml
|
# - https://github.com/flutter/packages/blob/main/analysis_options.yaml
|
||||||
#
|
#
|
||||||
# This file contains the analysis options used for code in the flutter/flutter
|
# This file contains the analysis options used for code in the flutter/flutter
|
||||||
@ -58,6 +58,7 @@ linter:
|
|||||||
- avoid_field_initializers_in_const_classes
|
- avoid_field_initializers_in_const_classes
|
||||||
# - avoid_final_parameters # incompatible with prefer_final_parameters
|
# - avoid_final_parameters # incompatible with prefer_final_parameters
|
||||||
- avoid_function_literals_in_foreach_calls
|
- avoid_function_literals_in_foreach_calls
|
||||||
|
# - avoid_futureor_void # not yet tested
|
||||||
# - avoid_implementing_value_types # see https://github.com/dart-lang/linter/issues/4558
|
# - avoid_implementing_value_types # see https://github.com/dart-lang/linter/issues/4558
|
||||||
- avoid_init_to_null
|
- avoid_init_to_null
|
||||||
- avoid_js_rounded_ints
|
- avoid_js_rounded_ints
|
||||||
@ -146,10 +147,10 @@ linter:
|
|||||||
- null_closures
|
- null_closures
|
||||||
# - omit_local_variable_types # opposite of always_specify_types
|
# - omit_local_variable_types # opposite of always_specify_types
|
||||||
# - omit_obvious_local_variable_types # not yet tested
|
# - omit_obvious_local_variable_types # not yet tested
|
||||||
|
# - omit_obvious_property_types # not yet tested
|
||||||
# - one_member_abstracts # too many false positives
|
# - one_member_abstracts # too many false positives
|
||||||
- only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al
|
- only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al
|
||||||
- overridden_fields
|
- overridden_fields
|
||||||
# - package_api_docs # Deprecated (https://github.com/dart-lang/linter/issues/5107)
|
|
||||||
- package_names
|
- package_names
|
||||||
- package_prefixed_library_names
|
- package_prefixed_library_names
|
||||||
# - parameter_assignments # we do this commonly
|
# - parameter_assignments # we do this commonly
|
||||||
@ -205,6 +206,8 @@ linter:
|
|||||||
# - sort_pub_dependencies # prevents separating pinned transitive dependencies
|
# - sort_pub_dependencies # prevents separating pinned transitive dependencies
|
||||||
- sort_unnamed_constructors_first
|
- sort_unnamed_constructors_first
|
||||||
# - specify_nonobvious_local_variable_types # not yet tested
|
# - specify_nonobvious_local_variable_types # not yet tested
|
||||||
|
# - specify_nonobvious_property_types # not yet tested
|
||||||
|
- strict_top_level_inference
|
||||||
- test_types_in_equals
|
- test_types_in_equals
|
||||||
- throw_in_finally
|
- throw_in_finally
|
||||||
- tighten_type_of_initializing_formals
|
- tighten_type_of_initializing_formals
|
||||||
@ -240,6 +243,7 @@ linter:
|
|||||||
- unnecessary_to_list_in_spreads
|
- unnecessary_to_list_in_spreads
|
||||||
- unreachable_from_main
|
- unreachable_from_main
|
||||||
- unrelated_type_equality_checks
|
- unrelated_type_equality_checks
|
||||||
|
# - unsafe_variance # not yet tested
|
||||||
- use_build_context_synchronously
|
- use_build_context_synchronously
|
||||||
- use_colored_box
|
- use_colored_box
|
||||||
# - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding)
|
# - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding)
|
||||||
|
@ -808,7 +808,7 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleUpKeyInvoke(_) {
|
void handleUpKeyInvoke(_ArrowUpIntent _) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (!widget.enabled || !_menuHasEnabledItem || !_controller.isOpen) {
|
if (!widget.enabled || !_menuHasEnabledItem || !_controller.isOpen) {
|
||||||
return;
|
return;
|
||||||
@ -828,7 +828,7 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDownKeyInvoke(_) {
|
void handleDownKeyInvoke(_ArrowDownIntent _) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (!widget.enabled || !_menuHasEnabledItem || !_controller.isOpen) {
|
if (!widget.enabled || !_menuHasEnabledItem || !_controller.isOpen) {
|
||||||
return;
|
return;
|
||||||
|
@ -1305,7 +1305,7 @@ class _ZoomEnterTransitionPainter extends SnapshotPainter {
|
|||||||
fade.addListener(notifyListeners);
|
fade.addListener(notifyListeners);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onStatusChange(_) {
|
void _onStatusChange(AnimationStatus _) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1414,7 +1414,7 @@ class _ZoomExitTransitionPainter extends SnapshotPainter {
|
|||||||
animation.addStatusListener(_onStatusChange);
|
animation.addStatusListener(_onStatusChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onStatusChange(_) {
|
void _onStatusChange(AnimationStatus _) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
|
|
||||||
import 'package:file/file.dart';
|
import 'package:file/file.dart';
|
||||||
import 'package:file/local.dart';
|
import 'package:file/local.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -168,11 +169,11 @@ dynamic testInvalidError(int square) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String? testDebugName(_) {
|
String? testDebugName(void _) {
|
||||||
return Isolate.current.debugName;
|
return Isolate.current.debugName;
|
||||||
}
|
}
|
||||||
|
|
||||||
int? testReturnNull(_) {
|
int? testReturnNull(void _) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user