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

Issue 2647833002: fix #28008, fix #28009 implement FutureOr<T> (Closed)

Created:
3 years, 11 months ago by Jennifer Messerly
Modified:
3 years, 11 months ago
CC:
dev-compiler+reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

fix #28008, fix #28009 implement FutureOr<T> This implements FutureOr<T> in strong mode, otherwise it's ignored (treated as `dynamic`. Also fixes strong mode's inference subtype function incorrectly treating `void` as a malformed type. This had the consequence of allowing `void` to be inferred as a type argument. R=leafp@google.com, paulberry@google.com Committed: https://github.com/dart-lang/sdk/commit/0e00b3e5c83e4173d442bf287eb99d1dd12cb09b

Patch Set 1 #

Total comments: 2

Patch Set 2 : fix DDC #

Patch Set 3 : fix #

Patch Set 4 : fix #

Patch Set 5 : fix #

Patch Set 6 : fix #

Patch Set 7 : add test #

Total comments: 32

Patch Set 8 : merged #

Patch Set 9 : comments #

Total comments: 1

Patch Set 10 : add tests, thanks Leaf! #

Patch Set 11 : rebase #

Patch Set 12 : Merge remote-tracking branch 'origin/master' into 28008_futureort #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1496 lines, -1007 lines) Patch
M pkg/analyzer/lib/dart/element/type.dart View 1 chunk +6 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/dart/element/element.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/dart/element/type.dart View 1 2 3 4 5 6 7 2 chunks +12 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/generated/resolver.dart View 1 2 3 4 5 6 7 8 9 chunks +50 lines, -64 lines 0 comments Download
M pkg/analyzer/lib/src/generated/static_type_analyzer.dart View 1 2 3 4 5 6 7 8 6 chunks +9 lines, -66 lines 0 comments Download
M pkg/analyzer/lib/src/generated/testing/element_factory.dart View 2 chunks +4 lines, -9 lines 0 comments Download
M pkg/analyzer/lib/src/generated/type_system.dart View 1 2 3 4 5 6 7 8 14 chunks +41 lines, -166 lines 0 comments Download
M pkg/analyzer/lib/src/summary/resynthesize.dart View 1 2 3 4 5 6 7 2 chunks +10 lines, -0 lines 0 comments Download
M pkg/analyzer/test/generated/analysis_context_factory.dart View 1 2 3 4 5 6 7 9 chunks +17 lines, -11 lines 0 comments Download
M pkg/analyzer/test/generated/resolver_test.dart View 1 2 3 4 5 6 7 3 chunks +3 lines, -1 line 0 comments Download
M pkg/analyzer/test/generated/strong_mode_test.dart View 1 2 3 4 5 6 7 8 9 10 5 chunks +333 lines, -0 lines 0 comments Download
M pkg/analyzer/test/src/context/mock_sdk.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/test/src/dart/element/element_test.dart View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M pkg/analyzer/test/src/summary/resynthesize_ast_test.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/test/src/summary/resynthesize_common.dart View 1 2 3 4 5 6 7 1 chunk +46 lines, -0 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/inferred_type_test.dart View 1 2 3 4 5 6 7 8 9 10 12 chunks +34 lines, -163 lines 0 comments Download
M pkg/dev_compiler/lib/js/amd/dart_sdk.js View 1 2 3 4 5 6 7 84 chunks +182 lines, -110 lines 0 comments Download
M pkg/dev_compiler/lib/js/common/dart_sdk.js View 1 2 3 4 5 6 7 84 chunks +182 lines, -110 lines 0 comments Download
M pkg/dev_compiler/lib/js/es6/dart_sdk.js View 1 2 3 4 5 6 7 84 chunks +182 lines, -110 lines 0 comments Download
M pkg/dev_compiler/lib/js/legacy/dart_sdk.js View 1 2 3 4 5 6 7 84 chunks +182 lines, -110 lines 0 comments Download
M pkg/dev_compiler/lib/sdk/ddc_sdk.sum View 1 2 3 4 5 6 7 Binary file 0 comments Download
M pkg/dev_compiler/lib/src/compiler/code_generator.dart View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -3 lines 0 comments Download
M pkg/dev_compiler/test/codegen_test.dart View 1 2 3 4 5 6 7 1 chunk +7 lines, -2 lines 0 comments Download
M pkg/dev_compiler/tool/input_sdk/lib/async/future.dart View 8 chunks +108 lines, -43 lines 0 comments Download
M pkg/dev_compiler/tool/input_sdk/lib/async/future_impl.dart View 8 chunks +29 lines, -20 lines 0 comments Download
M pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart View 1 2 3 4 5 6 7 8 3 chunks +27 lines, -2 lines 0 comments Download
M pkg/dev_compiler/tool/run.js View 1 1 chunk +1 line, -0 lines 0 comments Download
M pkg/dev_compiler/tool/sdk_expected_errors.txt View 1 2 3 4 5 6 7 4 chunks +13 lines, -2 lines 0 comments Download
M sdk/lib/async/future.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/async/future_impl.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/lib/async/future_or_bad_type_test.dart View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M tests/lib/lib.status View 1 2 3 4 1 chunk +0 lines, -5 lines 0 comments Download

Messages

Total messages: 29 (7 generated)
Paul Berry
It looks like some summary work is required to support FutureOr<T>. I'll work on that ...
3 years, 11 months ago (2017-01-23 16:42:15 UTC) #2
Paul Berry
https://codereview.chromium.org/2647833002/diff/1/pkg/analyzer/test/src/task/strong/inferred_type_test.dart File pkg/analyzer/test/src/task/strong/inferred_type_test.dart (right): https://codereview.chromium.org/2647833002/diff/1/pkg/analyzer/test/src/task/strong/inferred_type_test.dart#newcode5268 pkg/analyzer/test/src/task/strong/inferred_type_test.dart:5268: expect(y.type.toString(), 'void'); This change looks suspicious to me. I ...
3 years, 11 months ago (2017-01-23 19:31:46 UTC) #3
Paul Berry
On 2017/01/23 16:42:15, Paul Berry wrote: > It looks like some summary work is required ...
3 years, 11 months ago (2017-01-23 19:36:48 UTC) #4
Jennifer Messerly
(this change is not ready for review yet) https://codereview.chromium.org/2647833002/diff/1/pkg/analyzer/test/src/task/strong/inferred_type_test.dart File pkg/analyzer/test/src/task/strong/inferred_type_test.dart (right): https://codereview.chromium.org/2647833002/diff/1/pkg/analyzer/test/src/task/strong/inferred_type_test.dart#newcode5268 pkg/analyzer/test/src/task/strong/inferred_type_test.dart:5268: expect(y.type.toString(), ...
3 years, 11 months ago (2017-01-23 21:46:25 UTC) #5
Jennifer Messerly
Hi, this is ready for review. After a chat with rnystrom@ and further investigation, I ...
3 years, 11 months ago (2017-01-24 00:05:33 UTC) #10
Jennifer Messerly
On 2017/01/24 00:05:33, Jennifer Messerly wrote: > Hi, this is ready for review. > > ...
3 years, 11 months ago (2017-01-24 01:03:47 UTC) #11
Jennifer Messerly
https://codereview.chromium.org/2647833002/diff/120001/tests/lib/async/future_or_bad_type_test.dart File tests/lib/async/future_or_bad_type_test.dart (left): https://codereview.chromium.org/2647833002/diff/120001/tests/lib/async/future_or_bad_type_test.dart#oldcode22 tests/lib/async/future_or_bad_type_test.dart:22: Expect.isTrue(499 is FutureOr<A>); /// 00: static type warning I ...
3 years, 11 months ago (2017-01-24 01:21:22 UTC) #12
Paul Berry
On 2017/01/24 00:05:33, Jennifer Messerly wrote: > Hi, this is ready for review. > > ...
3 years, 11 months ago (2017-01-24 13:55:42 UTC) #13
Paul Berry
https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart File pkg/analyzer/lib/src/generated/static_type_analyzer.dart (right): https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart#newcode1430 pkg/analyzer/lib/src/generated/static_type_analyzer.dart:1430: if (_strongMode && staticType.isObject) { Why put this logic ...
3 years, 11 months ago (2017-01-24 17:45:13 UTC) #14
Jennifer Messerly
thanks! few thoughts https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart File pkg/analyzer/lib/src/generated/static_type_analyzer.dart (right): https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart#newcode1430 pkg/analyzer/lib/src/generated/static_type_analyzer.dart:1430: if (_strongMode && staticType.isObject) { On ...
3 years, 11 months ago (2017-01-24 18:58:20 UTC) #15
Paul Berry
https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart File pkg/analyzer/lib/src/generated/static_type_analyzer.dart (right): https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart#newcode1430 pkg/analyzer/lib/src/generated/static_type_analyzer.dart:1430: if (_strongMode && staticType.isObject) { On 2017/01/24 18:58:20, Jennifer ...
3 years, 11 months ago (2017-01-24 19:19:09 UTC) #16
Paul Berry
lgtm https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart File pkg/analyzer/lib/src/generated/static_type_analyzer.dart (right): https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/static_type_analyzer.dart#newcode1430 pkg/analyzer/lib/src/generated/static_type_analyzer.dart:1430: if (_strongMode && staticType.isObject) { On 2017/01/24 19:19:09, ...
3 years, 11 months ago (2017-01-24 20:14:50 UTC) #17
Leaf
A few questions, but I think this is looking really good! https://codereview.chromium.org/2647833002/diff/120001/pkg/analyzer/lib/src/generated/resolver.dart File pkg/analyzer/lib/src/generated/resolver.dart (right): ...
3 years, 11 months ago (2017-01-24 21:56:27 UTC) #18
Jennifer Messerly
Lasse, would you mind taking a look at the language test change? It's very small. ...
3 years, 11 months ago (2017-01-25 00:33:36 UTC) #20
Jennifer Messerly
https://codereview.chromium.org/2647833002/diff/120001/tests/lib/async/future_or_bad_type_test.dart File tests/lib/async/future_or_bad_type_test.dart (left): https://codereview.chromium.org/2647833002/diff/120001/tests/lib/async/future_or_bad_type_test.dart#oldcode5 tests/lib/async/future_or_bad_type_test.dart:5: // In non strong-mode, `FutureOr<T>` is dynamic, even if ...
3 years, 11 months ago (2017-01-25 00:37:09 UTC) #21
Jennifer Messerly
On 2017/01/25 00:37:09, Jennifer Messerly wrote: > https://codereview.chromium.org/2647833002/diff/120001/tests/lib/async/future_or_bad_type_test.dart > File tests/lib/async/future_or_bad_type_test.dart (left): > > https://codereview.chromium.org/2647833002/diff/120001/tests/lib/async/future_or_bad_type_test.dart#oldcode5 ...
3 years, 11 months ago (2017-01-25 00:38:45 UTC) #22
Lasse Reichstein Nielsen
https://codereview.chromium.org/2647833002/diff/160001/tests/lib/async/future_or_bad_type_test.dart File tests/lib/async/future_or_bad_type_test.dart (right): https://codereview.chromium.org/2647833002/diff/160001/tests/lib/async/future_or_bad_type_test.dart#newcode24 tests/lib/async/future_or_bad_type_test.dart:24: Expect.isTrue(499 is FutureOr<A, A>); /// 01: static type warning ...
3 years, 11 months ago (2017-01-25 08:11:19 UTC) #23
Paul Berry
Thanks, this addresses the issues I raised. Still lgtm (but of course we should wait ...
3 years, 11 months ago (2017-01-25 13:24:02 UTC) #24
Leaf
jmesserly can you please merge this CL (tests) into yours: https://codereview.chromium.org/2655133002
3 years, 11 months ago (2017-01-25 22:12:54 UTC) #25
Leaf
lgtm
3 years, 11 months ago (2017-01-25 22:40:00 UTC) #26
Jennifer Messerly
thanks everyone! landing now
3 years, 11 months ago (2017-01-25 23:32:35 UTC) #27
Jennifer Messerly
3 years, 11 months ago (2017-01-25 23:33:10 UTC) #29
Message was sent while issue was closed.
Committed patchset #12 (id:220001) manually as
0e00b3e5c83e4173d442bf287eb99d1dd12cb09b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698