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

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

Issue 2921533004: Annotate optional parameter inferred types in front end test cases. (Closed)
Patch Set: Created 3 years, 7 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 | pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
index 0d5db321665922de23708ad2bee6960fb539539f..afb9c1e37700a2a9bf27f6949e70b7fadc909f36 100644
--- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
+++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
@@ -319,7 +319,12 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
List<FormalParameter> parameters = node.parameters.parameters;
for (int i = 0; i < parameters.length; i++) {
FormalParameter parameter = parameters[i];
- if (parameter is SimpleFormalParameter && parameter.type == null) {
+ NormalFormalParameter normalParameter =
+ parameter is DefaultFormalParameter
+ ? parameter.parameter
+ : parameter;
+ if (normalParameter is SimpleFormalParameter &&
+ normalParameter.type == null) {
_recordType(parameter.offset, type.parameters[i].type);
}
}
« no previous file with comments | « no previous file | pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698