GROOVY-6029: Fix coercion of GString to a primitive type