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

Unified Diff: pkg/analyzer/lib/file_system/memory_file_system.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/file_system/memory_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index 3ec640e9a5b1bfa6e0a561ff489e92374f6aaf04..143e7191e80bcfc0b365e7dc27647f42f4be94f8 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -449,7 +449,12 @@ class _MemoryFileSource extends Source {
@override
bool operator ==(other) {
- return other is _MemoryFileSource && other.id == id;
+ if (other is _MemoryFileSource) {
+ return id == other.id;
+ } else if (other is Source) {
+ return uri == other.uri;
+ }
+ return false;
}
@override
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/optype_test.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698