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

Issue 1038213003: Downward inference (Closed)

Created:
5 years, 8 months ago by Leaf
Modified:
5 years, 8 months ago
Reviewers:
vsm
CC:
dev-compiler+reviews_dartlang.org
Base URL:
git@github.com:dart-lang/dart-dev-compiler.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Downward inference This is a first cut at downwards inference. The interaction with InferableLiteral etc isn't well sorted out yet, so while downwards inference on nested expressions works, there will currently be spurious warnings. BUG= R=vsm@google.com Committed: https://github.com/dart-lang/dev_compiler/commit/9cd58524e96dfe74b6779949f8979f83a429a48e

Patch Set 1 #

Patch Set 2 : Small fixes #

Total comments: 22

Patch Set 3 : Implement named arguments, some fixes #

Patch Set 4 : Address comments #

Total comments: 4

Patch Set 5 : Make Inferable{Literal,Allocation} errors #

Patch Set 6 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+868 lines, -418 lines) Patch
M lib/runtime/dart/_js_helper.js View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lib/runtime/dart/async.js View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M lib/runtime/dart/core.js View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lib/src/checker/rules.dart View 1 2 3 4 4 chunks +221 lines, -0 lines 0 comments Download
M lib/src/codegen/reify_coercions.dart View 1 2 3 4 4 chunks +48 lines, -2 lines 0 comments Download
M lib/src/info.dart View 1 2 3 4 6 chunks +60 lines, -19 lines 0 comments Download
M lib/src/options.dart View 1 2 3 6 chunks +15 lines, -2 lines 0 comments Download
M lib/src/testing.dart View 2 chunks +2 lines, -0 lines 0 comments Download
M test/checker/checker_test.dart View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M test/checker/inferred_type_test.dart View 1 2 3 4 1 chunk +240 lines, -0 lines 0 comments Download
M test/codegen/expect/server_mode/html_input.html View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M test/dart_codegen/expect/_internal/iterable.dart View 9 chunks +23 lines, -27 lines 0 comments Download
M test/dart_codegen/expect/async/broadcast_stream_controller.dart View 4 chunks +7 lines, -11 lines 0 comments Download
M test/dart_codegen/expect/async/future.dart View 1 2 3 4 4 chunks +4 lines, -12 lines 0 comments Download
M test/dart_codegen/expect/async/future_impl.dart View 1 2 3 4 7 chunks +16 lines, -20 lines 0 comments Download
M test/dart_codegen/expect/async/schedule_microtask.dart View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M test/dart_codegen/expect/async/stream.dart View 1 2 3 4 23 chunks +53 lines, -81 lines 0 comments Download
M test/dart_codegen/expect/async/stream_controller.dart View 1 2 3 4 4 chunks +6 lines, -10 lines 0 comments Download
M test/dart_codegen/expect/async/stream_impl.dart View 1 2 3 4 4 chunks +16 lines, -16 lines 0 comments Download
M test/dart_codegen/expect/async/stream_pipe.dart View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M test/dart_codegen/expect/async/stream_transformers.dart View 1 2 3 4 4 chunks +23 lines, -27 lines 0 comments Download
M test/dart_codegen/expect/async/timer.dart View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M test/dart_codegen/expect/async/zone.dart View 1 2 3 4 11 chunks +36 lines, -36 lines 0 comments Download
M test/dart_codegen/expect/collection/queue.dart View 1 2 3 4 3 chunks +3 lines, -11 lines 0 comments Download
M test/dart_codegen/expect/collection/splay_tree.dart View 1 2 3 4 12 chunks +28 lines, -44 lines 0 comments Download
M test/dart_codegen/expect/convert/json.dart View 5 chunks +8 lines, -12 lines 0 comments Download
M test/dart_codegen/expect/convert/latin1.dart View 1 chunk +1 line, -5 lines 0 comments Download
M test/dart_codegen/expect/convert/string_conversion.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M test/dart_codegen/expect/convert/utf.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M test/dart_codegen/expect/core/core View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M test/dart_codegen/expect/core/uri.dart View 1 2 3 4 14 chunks +29 lines, -49 lines 0 comments Download
M test/dart_codegen/expect/typed_data/typed_data View 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
Leaf
5 years, 8 months ago (2015-03-27 00:27:01 UTC) #2
vsm
very cool! first set of comments. https://codereview.chromium.org/1038213003/diff/20001/lib/src/checker/rules.dart File lib/src/checker/rules.dart (right): https://codereview.chromium.org/1038213003/diff/20001/lib/src/checker/rules.dart#newcode565 lib/src/checker/rules.dart:565: ////////// Called for ...
5 years, 8 months ago (2015-03-27 18:35:35 UTC) #3
vsm
Another round. https://codereview.chromium.org/1038213003/diff/20001/lib/src/checker/rules.dart File lib/src/checker/rules.dart (right): https://codereview.chromium.org/1038213003/diff/20001/lib/src/checker/rules.dart#newcode611 lib/src/checker/rules.dart:611: // two (if it exists). I wonder ...
5 years, 8 months ago (2015-03-27 21:20:59 UTC) #4
Leaf
Implemented support for named args on constructors, addressed comments. PTAL. https://codereview.chromium.org/1038213003/diff/20001/lib/src/checker/rules.dart File lib/src/checker/rules.dart (right): https://codereview.chromium.org/1038213003/diff/20001/lib/src/checker/rules.dart#newcode565 ...
5 years, 8 months ago (2015-03-30 23:26:00 UTC) #5
vsm
lgtm https://codereview.chromium.org/1038213003/diff/60001/lib/src/checker/rules.dart File lib/src/checker/rules.dart (right): https://codereview.chromium.org/1038213003/diff/60001/lib/src/checker/rules.dart#newcode559 lib/src/checker/rules.dart:559: ////////// Called for each list literal which gets ...
5 years, 8 months ago (2015-03-31 17:11:28 UTC) #6
Leaf
Committed patchset #6 (id:100001) manually as 9cd58524e96dfe74b6779949f8979f83a429a48e (presubmit successful).
5 years, 8 months ago (2015-03-31 20:24:30 UTC) #7
Leaf
5 years, 8 months ago (2015-04-03 19:24:52 UTC) #8
Message was sent while issue was closed.
Looks like I forgot to publish these comment replies.

https://codereview.chromium.org/1038213003/diff/60001/lib/src/checker/rules.dart
File lib/src/checker/rules.dart (right):

https://codereview.chromium.org/1038213003/diff/60001/lib/src/checker/rules.d...
lib/src/checker/rules.dart:559: ////////// Called for each list literal which
gets inferred /////
On 2015/03/31 17:11:28, vsm wrote:
> Nit: dart style is '///' as prefix:
> https://www.dartlang.org/articles/doc-comment-guidelines/

Done.

https://codereview.chromium.org/1038213003/diff/60001/test/checker/inferred_t...
File test/checker/inferred_type_test.dart (right):

https://codereview.chromium.org/1038213003/diff/60001/test/checker/inferred_t...
test/checker/inferred_type_test.dart:1246: A<int, String> a4 =
/*warning:InferableAllocation*/new A<int, dynamic>(3, "hello");
On 2015/03/31 17:11:28, vsm wrote:
> " ... should be severe:StaticTypeError" here and below?

Yes.  I was leaving this to address separately, but really no reason to delay. 
I've now made everything that would have been an InferableLiteral or
InferableAllocation into a StaticTypeError

Powered by Google App Engine
This is Rietveld 408576698