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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1910343002: Fix summary resynthesis in the event of a self-import. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 3768185d4c2acc5bf93e3344f65e6f451fbec5cf..a44ce9a1f6a596b16cd99e13115f68b04f28d2c4 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7272,6 +7272,27 @@ p.B b;
expectedPrefix: 'p');
}
+ test_import_self() {
+ if (!checkAstDerivedData) {
+ // TODO(paulberry): this test fails when building the summary from the
+ // element model because the element model can't tell the difference
+ // between self references via a local name and self references via a
+ // self-import.
+ return;
+ }
+ serializeLibraryText('''
+import 'test.dart' as p;
+class C {}
+class D extends p.C {} // Prevent "unused import" warning
+''');
+ expect(unlinkedUnits[0].imports[0].uri, 'test.dart');
+ checkDependency(
+ linked.importDependencies[0], absUri('/test.dart'), 'test.dart');
+ checkTypeRef(unlinkedUnits[0].classes[1].supertype, absUri('/test.dart'),
+ 'test.dart', 'C',
+ expectedPrefix: 'p');
+ }
+
test_import_show_order() {
String libraryText =
'import "dart:async" show Future, Stream; Future x; Stream y;';
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698