6e8180a40b
Prior to this fix, the "processedMembers" field on the ResolutionWorldBuilder was getting used as the signal that a member was active and therefore any conditional uses dependent on it should be active. In some cases the following would occur: 1) The listener gets a signal a member is active. It checks if there are any conditional uses for that member and sees none. 2) A conditional use is registered and the member is not indicated as active yet so the use is stored as pending in ResolutionEnqueuerListener. 3) "processedMembers" in ResolutionWorldBuilder is updated for a member that would mark the conditional use active. This doesn't trigger a check of the pending conditional uses. If the enqueues happen in this order (which is not always the case), the conditional impact will not be marked active and the field will be erroneously tree shaken. The solution here is to remove step 3 and add an analogous "usedMembers" update in step 1. Step 1 will always occur before step 2 so the conditional impact ledger and the usedMembers ledger will always stay in sync. Change-Id: Ib732a4fe5dcc8fc7cbe9a6d37e1c239e287595ff Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395740 Reviewed-by: Mayank Patke <fishythefish@google.com> Commit-Queue: Nate Biggs <natebiggs@google.com>