e8f57b6605
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/186680. After that change, tree shaker started reusing Reference to a Field when it is replaced with a getter. As a side-effect, this makes FieldInitializer.field to crash as Reference is now pointing to Procedure, not a Field. The fix is to carefully use 'node.fieldReference.asMember' instead of 'node.field' and then retrieve original Field node if it was replaced with a getter. TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_45324_2.dart Fixes https://github.com/dart-lang/sdk/issues/45324 Change-Id: Ic34e8b9933b00997cd350a4ad93f798c86ac60ad Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191323 Auto-Submit: Alexander Markov <alexmarkov@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>