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

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

Issue 2779003004: Don't disable downward inference inside initializers used for top-level inference. (Closed)
Patch Set: Created 3 years, 9 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/summary/top_level_inference_test.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 6cb88c14150def797c4573c275233bfc9b9748d8..bdfa015aa58b58f9c37088502beaf0a8d1015ddd 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -828,6 +828,25 @@ void main() {
''');
}
+ test_downwardsInference_insideTopLevel() async {
+ await checkFileElement('''
+class A {
+ B<int> b;
+}
+
+class B<T> {
+ B(T x);
+}
+
+var t1 = new A()..b = /*info:INFERRED_TYPE_ALLOCATION*/new B(1);
+var t2 = <B<int>>[/*info:INFERRED_TYPE_ALLOCATION*/new B(2)];
+var t3 = /*info:INFERRED_TYPE_LITERAL*/[
+ /*info:INFERRED_TYPE_ALLOCATION*/new
+ /*error:TOP_LEVEL_TYPE_ARGUMENTS*/B(3)
+ ];
+''');
+ }
+
test_downwardsInferenceAnnotations() async {
await checkFileElement('''
class Foo {
« no previous file with comments | « pkg/analyzer/test/src/summary/top_level_inference_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698