Files
sdk/pkg/analyzer/lib
Konstantin Shcheglov 84a4b01081 Store literal values and invocations arguments only for constants and untyped literals.
1. When a literal is typed, and is not a constant, we don't need its
   elements for type inference. Moreover, in this case elements are
   allowed to include nodes that are not immediately-evident expressions,
   such as instance creations without all type arguments, closures with
   block bodies, etc.

2. When a literal is a constant, so we still have to serialize all its
   elements, it is possible that we will encounter something not allowed
   for immediately-evident expressions, and fail. But that's OK, because
   such expressions are also not allowed in constants, so we will have
   a compile time error anyway, and IMHO it is OK to degrade a little
   in presence of errors.

3. The same is true for method invocations and instance creations,
   we need to serialize arguments only for constants, because top-level
   inference never uses arguments to infer returned types.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2779993002 .
2017-03-28 14:13:55 -07:00
..
2016-09-15 07:49:27 -07:00