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

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

Issue 2050083002: Fix equality between subclasses of Source (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/generated/source_io.dart
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
index 491e3ebc5be551eb1b2130952781f190f344f5cd..b7cb0fd5373789875a2b4a022b6f301df7d4c82d 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.dart
@@ -239,8 +239,14 @@ class FileBasedSource extends Source {
}
@override
- bool operator ==(Object object) =>
- object is FileBasedSource && id == object.id;
+ bool operator ==(Object object) {
+ if (object is FileBasedSource) {
+ return id == object.id;
+ } else if (object is Source) {
+ return uri == object.uri;
+ }
+ return false;
+ }
@override
bool exists() => file.isFile();
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/lib/src/summary/package_bundle_reader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698