1a75281742
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 Review URL: https://codereview.chromium.org/1416873003 .