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

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

Issue 1961753002: Fix reference sharing in the event that import prefixes are used. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/lib/src/summary/link.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 88b9e8ab7f9f5daf7aea2f6982ed013fdf82c611..47cea13575722b71b4683040f7bffb5d949e0cb7 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7682,6 +7682,19 @@ class C<T> extends B<T> {
checkLinkedTypeRef(type.typeArguments[1], 'dart:core', 'dart:core', 'int');
}
+ test_inferred_type_reference_shared_prefixed() {
+ if (!strongMode || skipFullyLinkedData) {
+ return;
+ }
+ // Variable `y` has an inferred type of `p.C`. Verify that the reference
+ // used by the explicit type of `x` is re-used for the inferred type.
+ addNamedSource('/a.dart', 'class C {}');
+ serializeLibraryText('import "a.dart" as p; p.C x; var y = new p.C();');
+ EntityRef xType = findVariable('x').type;
+ EntityRef yType = getTypeRefForSlot(findVariable('y').inferredTypeSlot);
+ expect(yType.reference, xType.reference);
+ }
+
test_inferred_type_refers_to_bound_type_param() {
if (!strongMode || skipFullyLinkedData) {
return;
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698