fix: preserve logical assignments to private state fields (#18594)