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

Unified Diff: pkg/analyzer/lib/src/generated/error_verifier.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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 6d4177b0f0e79829e10c2498d14eeead68461ac9..d1cbb72bff5931cf02461eee199ad3906df13236 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -4065,18 +4065,8 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
if (lhs == null) {
return;
}
- VariableElement leftVariableElement = getVariableElement(lhs);
- DartType leftType = (leftVariableElement == null)
- ? getStaticType(lhs)
- : leftVariableElement.type;
- MethodElement invokedMethod = assignment.staticElement;
- if (invokedMethod == null) {
- return;
- }
- DartType rightType = invokedMethod.type.returnType;
- if (leftType == null || rightType == null) {
- return;
- }
+ DartType leftType = getStaticType(lhs);
+ DartType rightType = getStaticType(assignment);
if (!_typeSystem.isAssignableTo(rightType, leftType)) {
_errorReporter.reportTypeErrorForNode(
StaticTypeWarningCode.INVALID_ASSIGNMENT, rhs, [rightType, leftType]);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698