GROOVY-6897: Fix regression in public API