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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2348583005: fix #27382, tweak inference heuristic when we have no upper bound info (Closed)
Patch Set: Created 4 years, 3 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/generated/type_system.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/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 85ee428d6c14cad827bb593b7b1c9e934865174d..640ded44e484b9994cadb3e2a920fb6b5c0f6a76 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -1767,6 +1767,20 @@ class C extends A {}
''');
}
+ void test_genericFunctions_returnTypedef() {
+ checkFile(r'''
+typedef void ToValue<T>(T value);
+
+main() {
+ ToValue/*<T>*/ f/*<T>*/(dynamic /*=T*/ x) => null;
+ var x = f/*<int>*/(42);
+ var y = f(42);
+ ToValue<int> takesInt = x;
+ takesInt = y;
+}
+ ''');
+ }
+
void test_genericMethods_basicDownwardInference() {
checkFile(r'''
/*=T*/ f/*<S, T>*/(/*=S*/ s) => null;
« no previous file with comments | « pkg/analyzer/lib/src/generated/type_system.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698