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

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

Issue 2933643002: Implement type inference for assignments to a static variable. (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/frontend_accessors.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart b/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart
index a81aa4f5ad596d65e752bf9d003eb278030a119b..5ac172b2c648783fbb73c1ff502f7732c3f613f2 100644
--- a/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart
@@ -576,17 +576,27 @@ class StaticAccessor extends Accessor {
BuilderHelper helper, this.readTarget, this.writeTarget, Token token)
: super(helper, token);
- Expression _makeRead(KernelComplexAssignment complexAssignment) =>
- readTarget == null
- ? makeInvalidRead()
- : helper.makeStaticGet(readTarget, token);
+ Expression _makeRead(KernelComplexAssignment complexAssignment) {
+ if (readTarget == null) {
+ return makeInvalidRead();
+ } else {
+ var read = helper.makeStaticGet(readTarget, token);
+ complexAssignment?.read = read;
+ return read;
+ }
+ }
Expression _makeWrite(Expression value, bool voidContext,
KernelComplexAssignment complexAssignment) {
- return writeTarget == null
- ? makeInvalidWrite(value)
- : new StaticSet(writeTarget, value)
- ..fileOffset = offsetForToken(token);
+ Expression write;
+ if (writeTarget == null) {
+ write = makeInvalidWrite(value);
+ } else {
+ write = new StaticSet(writeTarget, value);
+ complexAssignment?.write = write;
+ }
+ write.fileOffset = offsetForToken(token);
+ return write;
}
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698