Skip to content

Commit fa885b3

Browse files
MichaelRFairhurstcommit-bot@chromium.org
authored andcommitted
report undefined operator instead of method for bad +=.
Change-Id: Ia28fdb47c80768b011b05edc1e3e7b832f9335e8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105971 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
1 parent fc5eb09 commit fa885b3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/analyzer/lib/src/generated/element_resolver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class ElementResolver extends SimpleAstVisitor<void> {
169169
if (_shouldReportInvalidMember(staticType, staticMethod)) {
170170
_recordUndefinedToken(
171171
staticType.element,
172-
StaticTypeWarningCode.UNDEFINED_METHOD,
172+
StaticTypeWarningCode.UNDEFINED_OPERATOR,
173173
operator,
174174
[methodName, staticType.displayName]);
175175
}

pkg/analyzer/test/generated/static_type_warning_code_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ class B {
17321732
}
17331733
}
17341734
''', [
1735-
error(StaticTypeWarningCode.UNDEFINED_METHOD, 58, 2),
1735+
error(StaticTypeWarningCode.UNDEFINED_OPERATOR, 58, 2),
17361736
]);
17371737
}
17381738

0 commit comments

Comments
 (0)