Groovy closure not work with static final field from super class
问题 class Parent { final static String newLine = "*" } class Child extends Parent{ List body = [3, 4, 5] String toString() { def str = new StringBuilder() body.each { str.append(it + newLine) } str } } def c = new Child() println c The above is one trivial sample to illustrate the problem. It couldn't be compiled using Groovy plugin on Eclipse . Remove either final or static in the field of super class solves the problem. However, I have no idea why it's the case. http://groovy.codehaus.org