84a4b01081
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 .