Details
Description
@CompileStatic class MyGroove { private String str = null; def static main(args) { MyGroove myGroove = new MyGroove(); println myGroove.str myGroove.str = "abc" println myGroove.str.getClass() myGroove.str = new HashSet<String>() // compiles fine println myGroove.str // prints "[]" to the console // does not compile: [Static type checking] - Cannot assign // value of type java.util.ArrayList to variable of // type java.lang.String myGroove.str = new ArrayList<String>() } }