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

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

Issue 2540823002: Properly resolve dependency part paths in summary linker. (Closed)
Patch Set: Created 4 years, 1 month 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/resynthesize_common.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index 3e03093298b2b72964578633ee9f652898439942..d01ae2ec2e9e10ce4dffe728aa1cf9e3cec1fdbd 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -3617,6 +3617,32 @@ var v = f(g: (x, y) {});
' abstract class D { void set f(int g(String s)); }');
}
+ void test_inferredType_definedInSdkLibraryPart() {
+ addSource(
+ '/a.dart',
+ r'''
+import 'dart:async';
+class A {
+ m(Stream p) {}
+}
+''');
+ LibraryElement library = checkLibrary(r'''
+import 'a.dart';
+class B extends A {
+ m(p) {}
+}
+ ''');
+ ClassElement b = library.definingCompilationUnit.types[0];
+ ParameterElement p = b.methods[0].parameters[0];
+ // This test should verify that we correctly record inferred types,
+ // when the type is defined in a part of an SDK library. So, test that
+ // the type is actually in a part.
+ Element streamElement = p.type.element;
+ if (streamElement is ClassElement) {
+ expect(streamElement.source, isNot(streamElement.library.source));
+ }
+ }
+
void test_inferredType_usesSyntheticFunctionType_functionTypedParam() {
checkLibrary('''
int f(int x(String y)) => null;
« 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