GROOVY-6921: Closure shared variables loose inferred parameter type value