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

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

Issue 2842573002: Allow 'extract index' in top-level inference. (Closed)
Patch Set: Created 3 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/task/strong/checker.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/top_level_inference_test.dart
diff --git a/pkg/analyzer/test/src/summary/top_level_inference_test.dart b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
index c0ef180e6040876798a7b3ebc5dc8c894435cb67..b817ac070a06b0278af48bbf84525a31e5dd6d01 100644
--- a/pkg/analyzer/test/src/summary/top_level_inference_test.dart
+++ b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
@@ -127,6 +127,15 @@ var t2 = ((a = 1) == 0) != ((a = 2) == 0);
await checkFile(content);
}
+ test_initializer_extractIndex() async {
+ var content = r'''
+var a = /*info:INFERRED_TYPE_LITERAL*/[0, 1.2];
+var b0 = a[0];
+var b1 = a[1];
+''';
+ await checkFile(content);
+ }
+
test_initializer_functionLiteral_blockBody() async {
var content = r'''
var t = /*error:TOP_LEVEL_FUNCTION_LITERAL_BLOCK*/
@@ -871,6 +880,21 @@ dynamic x/*error: instanceGetter*/;
''');
}
+ test_initializer_extractIndex() async {
+ var library = await _encodeDecodeLibrary(r'''
+var a = [0, 1.2];
+var b0 = a[0];
+var b1 = a[1];
+''');
+ checkElementText(
+ library,
+ r'''
+List<num> a;
+num b0;
+num b1;
+''');
+ }
+
test_initializer_functionExpression() async {
var library = await _encodeDecodeLibrary(r'''
import 'dart:async';
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698