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

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

Issue 2928033005: Add type inference for assignment to local variables. (Closed)
Patch Set: Created 3 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/front_end/lib/src/fasta/kernel/fasta_accessors.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart b/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart
index eb83325d0ba1409b83ddb31243316e2afe3da750..d7ce053a3fbce60ed23339bcc41263c3393f8695 100644
--- a/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart
@@ -5,7 +5,12 @@
library fasta.fasta_accessors;
import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
- show KernelArguments, KernelComplexAssignment, KernelThisExpression;
+ show
+ KernelArguments,
+ KernelComplexAssignment,
+ KernelIndexAssign,
+ KernelThisExpression,
+ KernelVariableAssignment;
import 'package:front_end/src/fasta/kernel/utils.dart' show offsetForToken;
@@ -246,7 +251,8 @@ abstract class ErrorAccessor implements FastaAccessor {
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset: TreeNode.noOffset,
bool voidContext: false,
- Procedure interfaceTarget}) {
+ Procedure interfaceTarget,
+ bool isPreIncDec: false}) {
return buildError(new KernelArguments(<Expression>[value]), isGetter: true);
}
@@ -389,7 +395,8 @@ class ThisAccessor extends FastaAccessor {
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
{int offset: TreeNode.noOffset,
bool voidContext: false,
- Procedure interfaceTarget}) {
+ Procedure interfaceTarget,
+ bool isPreIncDec: false}) {
return buildAssignmentError();
}
@@ -491,7 +498,10 @@ class SendAccessor extends IncompleteSend {
}
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
- {int offset, bool voidContext: false, Procedure interfaceTarget}) {
+ {int offset,
+ bool voidContext: false,
+ Procedure interfaceTarget,
+ bool isPreIncDec: false}) {
return internalError("Unhandled");
}
@@ -547,7 +557,10 @@ class IncompletePropertyAccessor extends IncompleteSend {
}
Expression buildCompoundAssignment(Name binaryOperator, Expression value,
- {int offset, bool voidContext: false, Procedure interfaceTarget}) {
+ {int offset,
+ bool voidContext: false,
+ Procedure interfaceTarget,
+ bool isPreIncDec: false}) {
return internalError("Unhandled");
}
@@ -607,10 +620,7 @@ class IndexAccessor extends kernel.IndexAccessor with FastaAccessor {
@override
KernelComplexAssignment startComplexAssignment(Expression rhs) =>
- new KernelComplexAssignment()
- ..receiver = receiver
- ..index = index
- ..rhs = rhs;
+ new KernelIndexAssign(receiver, index, rhs);
}
class PropertyAccessor extends kernel.PropertyAccessor with FastaAccessor {
@@ -843,6 +853,10 @@ class VariableAccessor extends kernel.VariableAccessor with FastaAccessor {
}
toString() => "VariableAccessor()";
+
+ @override
+ KernelComplexAssignment startComplexAssignment(Expression rhs) =>
+ new KernelVariableAssignment(rhs);
}
class ReadOnlyAccessor extends kernel.ReadOnlyAccessor with FastaAccessor {
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698