|
Minor type inference fixes to do with null and bottom types.
This CL makes the following fixes:
- Updates analyzer's front_end_inference_test to represent the bottom
type as "<BottomType>" (consistent with Kernel).
- Implements type inference of "throw" expressions.
- Does not coerce bottom to dynamic when inferring the return type of
a closure.
- Does not coerce Null to dynamic when inferring the return type of a
block closure.
- Ignores bare "return;" statements when inferring the return type of
a block closure.
- Infers Null when a block closure lacks "return <expression>;"
statements.
- Implements correct rules for LUB(Null, x), by treating Null as
bottom.
R=scheglov@google.com
Committed: https://github.com/dart-lang/sdk/commit/830be5727d9e19b3086425ee4d3738c0cbba3771
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+561 lines, -25 lines) |
Patch |
|
M |
pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
|
View
|
|
5 chunks |
+30 lines, -11 lines |
0 comments
|
Download
|
|
M |
pkg/front_end/lib/src/fasta/type_inference/type_schema_environment.dart
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/front_end/test/fasta/strong.status
|
View
|
|
3 chunks |
+0 lines, -8 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.expect
|
View
|
|
1 chunk |
+59 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.expect
|
View
|
|
1 chunk |
+65 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_sync_star.dart.strong.expect
|
View
|
|
1 chunk |
+23 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/front_end/testcases/inference/block_bodied_lambdas_no_return.dart
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_no_return.dart.strong.expect
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart
|
View
|
|
1 chunk |
+82 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart.direct.expect
|
View
|
|
1 chunk |
+88 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart.outline.expect
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart.strong.expect
|
View
|
|
1 chunk |
+88 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart
|
View
|
|
1 chunk |
+27 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart.direct.expect
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart.outline.expect
|
View
|
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/coerce_bottom_and_null_types.dart.strong.expect
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/front_end/testcases/inference/infer_throw.dart
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/infer_throw.dart.strong.expect
|
View
|
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
A |
pkg/front_end/testcases/inference/inferred_type_block_closure_no_args_no_return.dart.strong.expect
|
View
|
|
1 chunk |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
pkg/front_end/testcases/inference/null_literal_should_not_infer_as_bottom.dart
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
pkg/front_end/testcases/inference/type_promotion_stopped_by_access_in_a_closure.dart.strong.expect
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
pkg/front_end/testcases/inference/type_promotion_stopped_by_mutation_in_a_closure.dart.strong.expect
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 5 (2 generated)
|