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

Issue 2886873005: Minor type inference fixes to do with null and bottom types. (Closed)

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

Description

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

Patch Set 1 #

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

Messages

Total messages: 5 (2 generated)
Paul Berry
3 years, 7 months ago (2017-05-17 03:20:14 UTC) #2
scheglov
LGTM
3 years, 7 months ago (2017-05-17 06:43:40 UTC) #3
Paul Berry
3 years, 7 months ago (2017-05-17 12:36:18 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
830be5727d9e19b3086425ee4d3738c0cbba3771 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698