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

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.dart

Issue 1374813002: fix inference of `hashCode` with library prefix (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index b6a959579daa8cde9549549b49bf7337665f73c5..7362c4de016b5baacdaf6d352a1cd2f69afa72a6 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1820,6 +1820,11 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
*/
bool _inferObjectAccess(
Expression node, DartType nodeType, SimpleIdentifier id) {
+ // If we have an access like `libraryPrefix.hashCode` don't infer it.
+ if (node is PrefixedIdentifier &&
+ node.prefix.staticElement is PrefixElement) {
+ return false;
+ }
// Search for Object accesses.
String name = id.name;
PropertyAccessorElement inferredElement =
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698