1 - Consider this reproducer https://github.com/ptomaszek/vertx-groovy
2 - Edit build.gradle and change vertxVersion to '4.0.0.Beta1' (uses Groovy 3.0.3)
3 - Edit org.example.MainGroovy and replace the code of main method with the following:
The code runs fine.
But, if in Step 2 the vertxVersion in build.gradle is changed to '4.0.0.Beta2' (uses Groovy 3.0.5), the code from Step 3 will fail with an IllegalStateException.
If you use @CompileStatic on main method with Step 3, with Beta2, it works fine. The @CompileStatic is not necessary to run well with Vert.x '4.0.0.Beta1'. A Java class with similar code will work using any version of Vert.x (Beta1, Beta2, Beta3, CR1....), so doesn't looks like a Java or Vertx issue.