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

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

Issue 2872323003: Propagate type inference through variable gets. (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 1d39d0e0e14f9e9fa3092fc7b919dfc3ef829355..1512e67fe83730ef8ef8039d8eca11b4e9980805 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
@@ -563,7 +563,7 @@ abstract class TypeInferrerImpl<S, E, V, F> extends TypeInferrer<S, E, V, F> {
TypePromotionFact<V> typePromotionFact,
TypePromotionScope typePromotionScope,
int offset,
- DartType declaredType,
+ DartType declaredOrInferredType,
void setPromotedType(DartType type)) {
DartType promotedType = typePromoter.computePromotedType(
typePromotionFact, typePromotionScope, mutatedInClosure);
@@ -575,9 +575,7 @@ abstract class TypeInferrerImpl<S, E, V, F> extends TypeInferrer<S, E, V, F> {
? new InstrumentationValueForType(promotedType)
: const InstrumentationValueLiteral('none'));
setPromotedType(promotedType);
- return typeNeeded
- ? (promotedType ?? declaredType ?? const DynamicType())
- : null;
+ return typeNeeded ? (promotedType ?? declaredOrInferredType) : null;
}
DartType inferVariableSet(
« 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