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

Issue 2768533002: Fasta type inference prototype #2

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

Description

Fasta type inference prototype #2

Patch Set 1 #

Patch Set 2 : Additional prototyping work #

Patch Set 3 : More work #

Patch Set 4 : Merge origin/master #

Total comments: 2

Patch Set 5 : Rework atop 415c868589d02e98eb839f48150f4203d5cecdb0 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+637 lines, -191 lines) Patch
M pkg/compiler/lib/src/parser/node_listener.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M pkg/front_end/front_end.iml View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/builder/ast_factory.dart View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/builder/shadow_ast.dart View 1 2 3 4 5 chunks +150 lines, -11 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/body_builder.dart View 1 2 3 4 63 chunks +151 lines, -122 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/builder_accessors.dart View 1 2 3 4 20 chunks +31 lines, -28 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart View 1 2 3 4 14 chunks +36 lines, -21 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_ast_factory.dart View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
A pkg/front_end/lib/src/fasta/type_inference/inference_target.dart View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A pkg/front_end/lib/src/fasta/type_inference/local_type_inferrer.dart View 1 2 3 4 1 chunk +52 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_async_upwards_flatten_local.dart View 1 1 chunk +6 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_async_upwards_flatten_local.dart.direct.expect View 1 1 chunk +33 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_async_upwards_local.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_async_upwards_local.dart.direct.expect View 1 1 chunk +32 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_downwards_local.dart View 1 1 chunk +5 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_downwards_local.dart.direct.expect View 1 1 chunk +7 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_parameter_reference_dynamic_local.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_parameter_reference_dynamic_local.dart.direct.expect View 1 1 chunk +6 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_parameter_reference_local.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_parameter_reference_local.dart.direct.expect View 1 1 chunk +7 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_upwards_local.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_body_upwards_local.dart.direct.expect View 1 1 chunk +7 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_parameter_downwards_local.dart View 1 1 chunk +5 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/closure_parameter_downwards_local.dart.direct.expect View 1 1 chunk +7 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/inference.status View 1 1 chunk +1 line, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/int_upwards_local.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/int_upwards_local.dart.direct.expect View 1 1 chunk +7 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/list_explicit_upwards_local.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/list_explicit_upwards_local.dart.direct.expect View 1 1 chunk +7 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/list_upwards_local.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/list_upwards_local.dart.direct.expect View 1 1 chunk +7 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/local_reference_upwards_local.dart View 1 1 chunk +6 lines, -0 lines 0 comments Download
A pkg/front_end/test/fasta/inference/local_reference_upwards_local.dart.direct.expect View 1 1 chunk +9 lines, -0 lines 0 comments Download
M pkg/front_end/test/fasta/testing.json View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M pkg/kernel/lib/ast.dart View 1 2 3 4 chunks +21 lines, -9 lines 0 comments Download

Messages

Total messages: 3 (1 generated)
scheglov
https://codereview.chromium.org/2768533002/diff/60001/pkg/front_end/lib/src/fasta/builder/shadow_ast.dart File pkg/front_end/lib/src/fasta/builder/shadow_ast.dart (right): https://codereview.chromium.org/2768533002/diff/60001/pkg/front_end/lib/src/fasta/builder/shadow_ast.dart#newcode95 pkg/front_end/lib/src/fasta/builder/shadow_ast.dart:95: throw new UnimplementedError('$context'); If I understand correctly, "context" will ...
3 years, 9 months ago (2017-03-24 15:38:10 UTC) #2
Paul Berry
3 years, 9 months ago (2017-03-24 17:59:50 UTC) #3
https://codereview.chromium.org/2768533002/diff/60001/pkg/front_end/lib/src/f...
File pkg/front_end/lib/src/fasta/builder/shadow_ast.dart (right):

https://codereview.chromium.org/2768533002/diff/60001/pkg/front_end/lib/src/f...
pkg/front_end/lib/src/fasta/builder/shadow_ast.dart:95: throw new
UnimplementedError('$context');
On 2017/03/24 15:38:10, scheglov wrote:
> If I understand correctly, "context" will be Iterable<String> here.
> 
> main() {
>   foo(['aaa', 'bbb']);
> }
> foo(Iterable<String> p) {}

You are correct.  This entire method is a hack that I put in place just to get
some simple cases prototyped, and I don't intend to ever land this code.  The
right way to do this is to do something like StaticTypeAnalyzer.inferListType
(pkg/analyzer/lib/src/generated/static_type_analyzer.dart), which sets up the
proper preconditions and then calls inferGenericFunctionOrType, which handles
the "Iterable" case as part of its general-purpose algorithm.

Powered by Google App Engine
This is Rietveld 408576698