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

Issue 1823793002: Better casting of for-in loops. (Closed)

Created:
4 years, 9 months ago by Bob Nystrom
Modified:
4 years, 9 months ago
Reviewers:
vsm
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Better casting of for-in loops. Generate a cast for each element, so that code like this can be handled correctly: for (String s in <dynamic>["a", "b", "c"]) { ... } Fixes #25916. R=vsm@google.com Committed: https://github.com/dart-lang/sdk/commit/bf4765009a5004fe1b9e2d1a09b84d41863a652f

Patch Set 1 #

Total comments: 8

Patch Set 2 : Handle supertypes of Iterable and Stream. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -33 lines) Patch
M pkg/analyzer/lib/src/generated/error_verifier.dart View 1 1 chunk +9 lines, -0 lines 0 comments Download
M pkg/analyzer/lib/src/task/strong/checker.dart View 1 5 chunks +50 lines, -22 lines 0 comments Download
M pkg/analyzer/lib/src/task/strong/info.dart View 1 chunk +9 lines, -9 lines 0 comments Download
M pkg/analyzer/test/generated/static_type_warning_code_test.dart View 1 1 chunk +20 lines, -0 lines 0 comments Download
M pkg/analyzer/test/src/context/mock_sdk.dart View 1 1 chunk +9 lines, -0 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/checker_test.dart View 1 1 chunk +67 lines, -0 lines 0 comments Download
M pkg/analyzer/test/src/task/strong/inferred_type_test.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
Bob Nystrom
There will be a little associated DDC work required to use this cast, but this ...
4 years, 9 months ago (2016-03-21 21:02:36 UTC) #2
Bob Nystrom
On 2016/03/21 21:02:36, Bob Nystrom wrote: > There will be a little associated DDC work ...
4 years, 9 months ago (2016-03-21 21:12:42 UTC) #3
vsm
https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart File pkg/analyzer/lib/src/task/strong/checker.dart (right): https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart#newcode336 pkg/analyzer/lib/src/task/strong/checker.dart:336: // Find up the element type of the sequence. ...
4 years, 9 months ago (2016-03-21 21:25:21 UTC) #4
Bob Nystrom
https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart File pkg/analyzer/lib/src/task/strong/checker.dart (right): https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart#newcode336 pkg/analyzer/lib/src/task/strong/checker.dart:336: // Find up the element type of the sequence. ...
4 years, 9 months ago (2016-03-21 22:44:55 UTC) #5
vsm
https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart File pkg/analyzer/lib/src/task/strong/checker.dart (right): https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart#newcode347 pkg/analyzer/lib/src/task/strong/checker.dart:347: if (iterableType.isDynamic) { On 2016/03/21 22:44:55, Bob Nystrom wrote: ...
4 years, 9 months ago (2016-03-21 22:50:36 UTC) #6
Bob Nystrom
https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart File pkg/analyzer/lib/src/task/strong/checker.dart (right): https://codereview.chromium.org/1823793002/diff/1/pkg/analyzer/lib/src/task/strong/checker.dart#newcode347 pkg/analyzer/lib/src/task/strong/checker.dart:347: if (iterableType.isDynamic) { On 2016/03/21 22:50:35, vsm wrote: > ...
4 years, 9 months ago (2016-03-21 23:00:44 UTC) #7
vsm
lgtm Might make sense to modify checkAssignment to (optionally?) suppress the error message.
4 years, 9 months ago (2016-03-21 23:06:08 UTC) #8
Bob Nystrom
On 2016/03/21 23:06:08, vsm wrote: > lgtm > > Might make sense to modify checkAssignment ...
4 years, 9 months ago (2016-03-21 23:14:23 UTC) #9
vsm
On 2016/03/21 23:14:23, Bob Nystrom wrote: > On 2016/03/21 23:06:08, vsm wrote: > > lgtm ...
4 years, 9 months ago (2016-03-21 23:30:01 UTC) #10
Bob Nystrom
4 years, 9 months ago (2016-03-21 23:37:34 UTC) #12
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
bf4765009a5004fe1b9e2d1a09b84d41863a652f (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698