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

Issue 2968563002: Introduce a reusable mechanism for representing synthetic kernel objects. (Closed)

Created:
3 years, 5 months ago by Paul Berry
Modified:
3 years, 5 months ago
Reviewers:
scheglov
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Introduce a reusable mechanism for representing synthetic kernel objects. We introduce a class KernelSyntheticExpression which can be used for synthetic expressions introduced by the front end. It is used for expressions that represent errors detected by the front end, and it is also the base class for KernelComplexAssignment. By default, type inference skips these synthetic expressions, inferring a type of `dynamic`. (Note, however, that classes dervied from KernelComplexAssignment override this behavior). We also introduce a class KernelSyntheticStatement which behaves similarly, but is used for statements rather than expressions, e.g. the synthetic assignment introduced at the top of a "for" loop whose loop variable is defined elsewhere. Finally, we modify KernelTypeInferrer.inferFieldTopLevel() so that it deliberatly infers `dynamic` for fields that lack an initializer. Previously this behavior happened as a result of the hack in KernelTypeInferrer.inferExpression which caused type inference to infer `dynamic` for anything that didn't implement KernelExpression. All of these changes should help pave the way for removing the aforementioned hack. R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/e2037dc9d103dce4240106f31c9131d44a7587ce

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -35 lines) Patch
M pkg/front_end/lib/src/fasta/kernel/body_builder.dart View 4 chunks +9 lines, -8 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart View 4 chunks +87 lines, -27 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
Paul Berry
3 years, 5 months ago (2017-06-29 20:24:07 UTC) #2
scheglov
LGTM
3 years, 5 months ago (2017-06-29 20:36:30 UTC) #3
Paul Berry
3 years, 5 months ago (2017-06-29 20:47:57 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
e2037dc9d103dce4240106f31c9131d44a7587ce (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698