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

Issue 1416873003: Rework handling of potentially-constant variables. (Closed)

Created:
5 years, 2 months ago by Paul Berry
Modified:
5 years, 2 months ago
Reviewers:
scheglov
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Rework handling of potentially-constant variables. Previously, we had a mixin class PotentiallyConstVariableElement to represent variables which might be constant. This left some holes in the type hierarchy which didn't implement PotentiallyConstVariableElement but nonetheless could be reached by constant evaluation code in the event of errors in the code being analyzed, resulting in an invalid cast exception. This CL drops PotentiallyConstVariableElement and moves its one getter to VariableElementImpl so that it will be available to all variable elements. This allows us to avoid a lot of casts, including the one that previously caused the exception. Fixes #24645. R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/1a7528174263af0a95d7edf51c01a2b3d1b568ff

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -39 lines) Patch
M pkg/analyzer/lib/src/generated/constant.dart View 5 chunks +21 lines, -12 lines 0 comments Download
M pkg/analyzer/lib/src/generated/element.dart View 7 chunks +13 lines, -27 lines 0 comments Download
M pkg/analyzer/test/generated/compile_time_error_code_test.dart View 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Paul Berry
5 years, 2 months ago (2015-10-20 18:03:13 UTC) #2
scheglov
LGTM
5 years, 2 months ago (2015-10-20 18:06:33 UTC) #3
Paul Berry
5 years, 2 months ago (2015-10-20 19:37:14 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
1a7528174263af0a95d7edf51c01a2b3d1b568ff (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698