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

Issue 2984013002: Implement AstBuilder integration for method/function invocations. (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

Implement AstBuilder integration for method/function invocations. This is tricky because there isn't a clean correspondence between analyzer's AST (which reflects user syntax) and kernel representation. For example: f(args); could be a call to a static function f, a method f in the current class, or an invocation of a function-typed object stored in a variable called f. ResolutionStorer operates on the kernel representation, so it sees the difference, but ResolutionApplier operates on the analyzer AST, so it does not. So we go to some extra work to make sure a type is stored for f, regardless of whether f is a function, method, or a variable. This requires some re-ordering logic in ResolutionStorer, since the inferred type of f is not known until after the args have been visited. The implementation is not complete; currently the type that we store in the first two cases is `dynamic` because the type inference mechanism doesn't preserve enough information to allow us to determine the correct type; this will be remidied in a future CL. A similar situation occurs for: x.m(args); which could be a call to a method m in the object x, or an invocation of a function-typed object returned by the getter m in the object x. R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/c057f091c211d119aec4bb3e89c06c5b4eb04a36

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -16 lines) Patch
M pkg/analyzer/lib/src/fasta/analyzer_diet_listener.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/lib/src/fasta/resolution_applier.dart View 1 chunk +2 lines, -1 line 3 comments Download
M pkg/analyzer/lib/src/fasta/resolution_storer.dart View 3 chunks +74 lines, -3 lines 0 comments Download
M pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart View 1 chunk +4 lines, -1 line 0 comments Download
M pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart View 2 chunks +3 lines, -1 line 0 comments Download
M pkg/front_end/testcases/ast_builder.status View 8 chunks +4 lines, -10 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Paul Berry
3 years, 5 months ago (2017-07-21 00:14:15 UTC) #2
scheglov
LGTM https://codereview.chromium.org/2984013002/diff/1/pkg/analyzer/lib/src/fasta/resolution_applier.dart File pkg/analyzer/lib/src/fasta/resolution_applier.dart (right): https://codereview.chromium.org/2984013002/diff/1/pkg/analyzer/lib/src/fasta/resolution_applier.dart#newcode41 pkg/analyzer/lib/src/fasta/resolution_applier.dart:41: node.methodName.staticType = _getTypeFor(node.methodName); Could we move this statement ...
3 years, 5 months ago (2017-07-21 04:03:04 UTC) #3
Paul Berry
https://codereview.chromium.org/2984013002/diff/1/pkg/analyzer/lib/src/fasta/resolution_applier.dart File pkg/analyzer/lib/src/fasta/resolution_applier.dart (right): https://codereview.chromium.org/2984013002/diff/1/pkg/analyzer/lib/src/fasta/resolution_applier.dart#newcode41 pkg/analyzer/lib/src/fasta/resolution_applier.dart:41: node.methodName.staticType = _getTypeFor(node.methodName); On 2017/07/21 04:03:03, scheglov wrote: > ...
3 years, 5 months ago (2017-07-21 17:40:11 UTC) #4
scheglov
Still LGTM. https://codereview.chromium.org/2984013002/diff/1/pkg/analyzer/lib/src/fasta/resolution_applier.dart File pkg/analyzer/lib/src/fasta/resolution_applier.dart (right): https://codereview.chromium.org/2984013002/diff/1/pkg/analyzer/lib/src/fasta/resolution_applier.dart#newcode41 pkg/analyzer/lib/src/fasta/resolution_applier.dart:41: node.methodName.staticType = _getTypeFor(node.methodName); On 2017/07/21 17:40:11, Paul ...
3 years, 5 months ago (2017-07-21 17:43:58 UTC) #5
Paul Berry
3 years, 5 months ago (2017-07-21 17:47:31 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
c057f091c211d119aec4bb3e89c06c5b4eb04a36 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698