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

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

Issue 2225413002: fix #26139, allow inferring a more precise return type (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add comment Created 4 years, 4 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/context/mock_sdk.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 4dbcbfeba20c30dcb2d97385dd462a4b812bbbf9..1b8d9713b1432e9933b344ec4d80e4f2be4d9ee2 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -2554,6 +2554,18 @@ main() {
expect(fns[9].type.toString(), '() → Stream<int>');
}
+ void test_inferReturnOfStatementLambda() {
+ // Regression test for https://github.com/dart-lang/sdk/issues/26139
+ checkFile(r'''
+List<String> strings() {
+ var stuff = [].expand(/*info:INFERRED_TYPE_CLOSURE*/(i) {
+ return <String>[];
+ });
+ return stuff.toList();
+}
+ ''');
+ }
+
void test_inferred_nonstatic_field_depends_on_static_field_complex() {
var mainUnit = checkFile('''
class C {
« no previous file with comments | « pkg/analyzer/test/src/context/mock_sdk.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698