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

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

Issue 1874123002: Infer generic method invocation type. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge, additional tests and fixes. 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/lib/src/summary/link.dart ('k') | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
index 2490d43c85e7c6594077e5448c96fcf2a95853cb..3715381c9a4f367eaf2e81667c1144a095fe4b59 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
@@ -406,6 +406,26 @@ var b2 = new B<int>();
super.test_inferTypesOnGenericInstantiationsInLibraryCycle();
}
+ void test_invokeMethod_notGeneric_genericClass() {
+ var unit = checkFile(r'''
+class C<T> {
+ T m(int a, {String b, T c}) => null;
+}
+var v = new C<double>().m(1, b: 'bbb', c: 2.0);
+ ''');
+ expect(unit.topLevelVariables[0].type.toString(), 'double');
+ }
+
+ void test_invokeMethod_notGeneric_notGenericClass() {
+ var unit = checkFile(r'''
+class C {
+ int m(int a, {String b, int c}) => null;
+}
+var v = new C().m(1, b: 'bbb', c: 2.0);
+ ''');
+ expect(unit.topLevelVariables[0].type.toString(), 'int');
+ }
+
@override
@failingTest
void test_listLiteralsShouldNotInferBottom() {
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698