Rework EvaluationResultImpl class hierarchy.
This CL changes EvaluationResultImpl from abstract to concrete, and
eliminates its derived classes, ValidResult and ErrorResult. This
eliminates the dichotomy between "compile time constant that computed
successfully" and "compile time constant that failed to compute
because of errors", so that we can keep track of errors encountered
during successful evaluation of a constant (this is necessary to
support checked mode compile-time errors). It also avoids the need to
do double dispatch between the two derived classes in order to
evaluate constants involving binary operators.
We now keep track of constant evaluation errors my accumulating them
into a list (which is passed as a constructor argument into
ConstantVisitor). This allows ConstantVisitor to represent its
intermediate values using DartObjectImpl directly, and fixes some
corner cases where we were dropping or duplicating constant evaluation
errors.
As a result of fixing the corner cases, issue 21177 is exposed.
(Previously the test "compile_time_constant10_test/none" failed to
show the bug due to the error being dropped).
R=brianwilkerson@google.com
Committed:
https://code.google.com/p/dart/source/detail?r=40856