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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2904653002: Always record inference of implicit function expression params, even if dynamic. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 1ce20e24d8004f6b10836c61d1d4a3edd4594640..05d7c6fc98b660d87af6576b8eadd98a50af3a95 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -427,16 +427,19 @@ class KernelFunctionExpression extends FunctionExpression
for (int i = 0; i < formals.length; i++) {
KernelVariableDeclaration formal = formals[i];
if (KernelVariableDeclaration.isImplicitlyTyped(formal)) {
+ DartType inferredType;
if (formalTypesFromContext[i] != null) {
- var inferredType = greatestClosure(inferrer.coreTypes,
+ inferredType = greatestClosure(inferrer.coreTypes,
substitution.substituteType(formalTypesFromContext[i]));
- inferrer.instrumentation?.record(
- Uri.parse(inferrer.uri),
- formal.fileOffset,
- 'type',
- new InstrumentationValueForType(inferredType));
- formal.type = inferredType;
+ } else {
+ inferredType = const DynamicType();
}
+ inferrer.instrumentation?.record(
+ Uri.parse(inferrer.uri),
+ formal.fileOffset,
+ 'type',
+ new InstrumentationValueForType(inferredType));
+ formal.type = inferredType;
}
}
« 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