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

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

Issue 2109353004: Revert "fix #25794, infer parameter type from default value" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
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 d31dcd434f2c870b226688614d3cc4104e7f7121..881ad8f9b8f9232b7bcd667187a39b33d9cf6407 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -4107,7 +4107,9 @@ void f<T, U>() {
checkLibrary('class C { bool operator<=(C other) => false; }');
}
- test_parameterType_inferred_constructor() {
+ 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]);
@@ -4116,31 +4118,36 @@ class C {
''');
}
- test_parameterType_inferred_staticMethod() {
+ 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 {
- static void positional([x = 1]) {}
- static void named({x: 1}) {}
+ var x;
+ C.positional([this.x = 1]);
+ C.named({this.x: 1});
}
''');
}
- test_parameterType_inferred_topLevelFunction() {
+ 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('''
-void positional([x = 1]) {}
-void named({x: 1}) {}
+class C {
+ static void positional([x = 1]) {}
+ static void 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.
+ 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('''
-class C {
- var x;
- C.positional([this.x = 1]);
- C.named({this.x: 1});
-}
+void positional([x = 1]) {}
+void named({x: 1}) {}
''');
}
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_ast_test.dart ('k') | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698