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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2915763008: Perform type inference on default values of optional/named parameters. (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 | « pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart ('k') | pkg/front_end/test/fasta/kompile.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 5e064d168d61c397e9f89fb6ab510b72f0e6a0e0..dc9d033e9584b9717516fb3ef72f8aede2087baa 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -177,6 +177,10 @@ abstract class TypeInferrer {
/// Performs type inference on the given constructor initializer.
void inferInitializer(Initializer initializer);
+
+ /// Performs type inference on the given function parameter initializer
+ /// expression.
+ void inferParameterInitializer(Expression initializer, DartType declaredType);
}
/// Derived class containing generic implementations of [TypeInferrer].
@@ -489,6 +493,13 @@ abstract class TypeInferrerImpl extends TypeInferrer {
return inferredType;
}
+ @override
+ void inferParameterInitializer(
+ Expression initializer, DartType declaredType) {
+ assert(closureContext == null);
+ inferExpression(initializer, declaredType, false);
+ }
+
/// Modifies a type as appropriate when inferring a closure return type.
DartType inferReturnType(DartType returnType, bool isExpressionFunction) {
if (returnType == null) {
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart ('k') | pkg/front_end/test/fasta/kompile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698