|
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
|
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
|
Total messages: 6 (3 generated)
|