9 ms·
The other poster is right. That is typing, that is not static type checking. You can write code like: List<MyObject> mylist = new HashSet<Integer>() {{ add("s
by tmarthal 12y ago
The other poster is right. That is typing, that is not static type checking.
You can write code like:
List<MyObject> mylist = new HashSet<Integer>() {{ add("string"); add(1L); }}
You will get groovy.lang.GroovyRuntimeException with constructor issues.