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

Issue 2954063002: Small fixes to top level type inference. (Closed)

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

Description

Small fixes to top level type inference. This CL makes two fixes: 1. When a field is visited for the second time (to infer subexpressions), don't use the inferred field type as the context; this can change the inference results in a few rare circumstances, making it different from what would be inferred inside a method body. 2. When doing extended top level type inference is enabled, only skip subexpressions whose type is not needed. Note that some tests had to be moved (either partially or completely) into pkg/front_end/testcases/inference_new to reflect the fact that front_end type inference now produces more correct results than analyzer. Also, the annotation comments in pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart were completely bogus and needed to be changed. R=ahe@google.com Committed: https://github.com/dart-lang/sdk/commit/20c25f5cfc3e07e03b1718bc4865f3c1a0f14dc8

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -111 lines) Patch
M pkg/front_end/lib/src/fasta/builder/field_builder.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/body_builder.dart View 1 chunk +2 lines, -1 line 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_field_builder.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart View 1 chunk +2 lines, -1 line 0 comments Download
M pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart View 1 chunk +3 lines, -1 line 0 comments Download
M pkg/front_end/test/fasta/kompile.status View 2 chunks +5 lines, -0 lines 0 comments Download
M pkg/front_end/test/fasta/strong.status View 1 chunk +0 lines, -2 lines 0 comments Download
M pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart View 1 chunk +0 lines, -4 lines 0 comments Download
M pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.expect View 1 chunk +0 lines, -1 line 0 comments Download
M pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart View 1 chunk +0 lines, -4 lines 0 comments Download
M pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.expect View 1 chunk +0 lines, -1 line 0 comments Download
M pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.outline.expect View 1 chunk +0 lines, -1 line 0 comments Download
M pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.expect View 1 chunk +0 lines, -1 line 0 comments Download
D pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart View 1 chunk +0 lines, -15 lines 0 comments Download
D pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.expect View 1 chunk +0 lines, -12 lines 0 comments Download
D pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart View 1 chunk +0 lines, -15 lines 0 comments Download
D pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.expect View 1 chunk +0 lines, -12 lines 0 comments Download
M pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart View 1 chunk +0 lines, -2 lines 0 comments Download
M pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.expect View 1 chunk +0 lines, -1 line 0 comments Download
M pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart View 1 chunk +5 lines, -5 lines 0 comments Download
M pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.expect View 1 chunk +3 lines, -3 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart View 1 chunk +12 lines, -6 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.expect View 1 chunk +1 line, -3 lines 0 comments Download
A pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.outline.expect View 1 chunk +16 lines, -0 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.expect View 1 chunk +1 line, -3 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart View 1 chunk +9 lines, -7 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.expect View 1 chunk +0 lines, -1 line 0 comments Download
A + pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.outline.expect View 1 chunk +0 lines, -1 line 0 comments Download
A + pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.expect View 1 chunk +1 line, -2 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.expect View 1 chunk +1 line, -1 line 0 comments Download
A pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.outline.expect View 1 chunk +9 lines, -0 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.expect View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart View 1 chunk +1 line, -1 line 0 comments Download
A + pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.expect View 1 chunk +1 line, -1 line 0 comments Download
A pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.outline.expect View 1 chunk +9 lines, -0 lines 0 comments Download
A + pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.expect View 1 chunk +1 line, -1 line 0 comments Download
A pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart View 1 chunk +22 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.expect View 1 chunk +15 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.outline.expect View 1 chunk +11 lines, -0 lines 0 comments Download
A pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.expect View 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (3 generated)
Paul Berry
3 years, 6 months ago (2017-06-23 03:44:03 UTC) #2
ahe
lgtm
3 years, 6 months ago (2017-06-23 12:42:15 UTC) #4
Paul Berry
3 years, 6 months ago (2017-06-23 17:48:04 UTC) #6
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
20c25f5cfc3e07e03b1718bc4865f3c1a0f14dc8 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698