Simplify fix for PR 14030

Please merge into 6.0
Fix `provide:` when it's after the definition

Closes PR 11172

Please merge into 6.0