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

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

Issue 2166133002: fix #26912, correct handling of op assign (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 7e00395e52b5b1bc96f2a7d8300094b14bdd3d80..568bf3069595ddaff612925f49439cd640106c25 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -633,6 +633,7 @@ class CodeChecker extends RecursiveAstVisitor {
if (!rules.isSubtypeOf(returnType, lhsType)) {
final numType = typeProvider.numType;
+ // TODO(jmesserly): this seems to duplicate logic in StaticTypeAnalyzer.
// Try to fix up the numerical case if possible.
if (rules.isSubtypeOf(lhsType, numType) &&
rules.isSubtypeOf(lhsType, rhsType)) {
@@ -640,6 +641,8 @@ class CodeChecker extends RecursiveAstVisitor {
// compound operators in the int += num and num += dynamic cases.
_recordImplicitCast(expr.rightHandSide, rhsType, lhsType);
} else {
+ // TODO(jmesserly): this results in a duplicate error, because
+ // ErrorVerifier also reports it.
_recordMessage(expr, StrongModeCode.STATIC_TYPE_ERROR,
[expr, returnType, lhsType]);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.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