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

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

Issue 1704663002: Add tests to validate assumptions made by summaries about type inference. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | 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/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index d6c1b518076f3521f7bf60f3f1745df58dfbfbd6..28f7af2397b989029b8162a180997171387d0075 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -3151,6 +3151,50 @@ void f<T, U>() {
checkLibrary('class C { bool operator<=(C other) => false; }');
}
+ test_parameterTypeNotInferred_constructor() {
+ // Strong mode doesn't do type inference on constructor parameters, so it's
+ // ok that we don't store inferred type info for them in summaries.
+ checkLibrary('''
+class C {
+ C.positional([x = 1]);
+ C.named({x: 1});
+}
+''');
+ }
+
+ test_parameterTypeNotInferred_initializingFormal() {
+ // Strong mode doesn't do type inference on initializing formals, so it's
+ // ok that we don't store inferred type info for them in summaries.
+ checkLibrary('''
+class C {
+ var x;
+ C.positional([this.x = 1]);
+ C.named({this.x: 1});
+}
+''');
+ }
+
+ test_parameterTypeNotInferred_staticMethod() {
+ // Strong mode doesn't do type inference on parameters of static methods,
+ // so it's ok that we don't store inferred type info for them in summaries.
+ checkLibrary('''
+class C {
+ static void positional([x = 1]) {}
+ static void named({x: 1}) {}
+}
+''');
+ }
+
+ test_parameterTypeNotInferred_topLevelFunction() {
+ // Strong mode doesn't do type inference on parameters of top level
+ // functions, so it's ok that we don't store inferred type info for them in
+ // summaries.
+ checkLibrary('''
+void positional([x = 1]) {}
+void named({x: 1}) {}
+''');
+ }
+
test_parts() {
addNamedSource('/a.dart', 'part of my.lib;');
addNamedSource('/b.dart', 'part of my.lib;');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698