Finally, the idea of completed action can be used simply to place a Present Perfect action earlier than another action in -ing forms, infinitives or subordinate clauses.
right: she will pay you when you ask her.
right: she will pay you when you have taken out the garbage.