daae24b488
Evaluated constant instances in kernel are represented as a list of field->value pairs. Tree shaker should not remove fields used in constants as it may potentially affect identity of constant instances (non-identical constants may become identical). Previously, fields used in constants were only marked as written, so they could still be removed as write-only fields. Furthermore, if such field was also used as an interface target it could be converted to an abstract getter, causing the conflict during kernel AST serialization. This fix marks fields used in constants as also read, effectively preventing their tree shaking. Flutter gallery AOT snapshot size is not affected. TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_45324.dart Fixes https://github.com/dart-lang/sdk/issues/45324 Change-Id: Id6d35604757ad6ba1e23f7227aa9b769448c2688 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191280 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>