I'm not sure if this is already possible but is it possible to use @CompileStatic on just plain groovy scripts without wrapping the script in a class?

I'm using the GroovyClassLoader to parse and compile scripts dynamically and so it would be nice if scripts could use @CompileStatic