Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.dart

Issue 3004113002: Revert "Add a hint on static uses of fuzzy arrows." (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/task/strong/checker.dart
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index e6e2b34f0dc0f66dcf6f1704bd0886e9806be61b..e09f6af3f3b8fec50d6c82c46e312c3ac9826b7d 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -772,8 +772,6 @@ class CodeChecker extends RecursiveAstVisitor {
{DartType from, bool opAssign: false, bool isDeclarationCast: false}) {
from ??= _getDefiniteType(expr);
- _hintOnFuzzyArrows(expr, to, from: from);
-
if (_needsImplicitCast(expr, to,
from: from, isDeclarationCast: isDeclarationCast) ==
true) {
@@ -1077,23 +1075,6 @@ class CodeChecker extends RecursiveAstVisitor {
return rules.anyParameterType(ft, (pt) => pt.isDynamic);
}
- void _hintOnFuzzyArrows(Expression expr, DartType to, {DartType from}) {
- from ??= _getDefiniteType(expr);
-
- // If it is a subtype with fuzzy arrows on,
- // check to see if it still is with them off.
- if (rules.isSubtypeOf(from, to)) {
- try {
- rules.allowDynamicAsBottom = false;
- // If still true, no warning needed
- if (rules.isSubtypeOf(from, to)) return;
- _recordMessage(expr, HintCode.USES_DYNAMIC_AS_BOTTOM, [from, to]);
- } finally {
- rules.allowDynamicAsBottom = true;
- }
- }
- }
-
/// Returns true if we need an implicit cast of [expr] from [from] type to
/// [to] type, returns false if no cast is needed, and returns null if the
/// types are statically incompatible.
@@ -1243,9 +1224,7 @@ class CodeChecker extends RecursiveAstVisitor {
errorCode.name.startsWith('STRONG_MODE_TOP_LEVEL_')) {
severity = ErrorSeverity.ERROR;
}
- if (severity != ErrorSeverity.INFO ||
- _options.strongModeHints ||
- errorCode == HintCode.USES_DYNAMIC_AS_BOTTOM) {
+ if (severity != ErrorSeverity.INFO || _options.strongModeHints) {
int begin = node is AnnotatedNode
? node.firstTokenAfterCommentAndMetadata.offset
: node.offset;
« no previous file with comments | « pkg/analyzer/lib/src/generated/type_system.dart ('k') | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698