0
我有以下特點:未知類型:METHOD_DEF對Groovy特質
trait DataSource{
private File handle
private List data
def readFile(String target){
try{
handle = new File(target)
data = handle.readLines()
}catch(FileNotFoundException fnf){
return false;
}
}
def printLines(){
for(int i = 0; i < data.size(); i++){
println(data.get(i));
}
}
def getData(){
if(data != null){
return data
}else{
return false;
}
}
def getHandle(){
if(handle != null){
return handle
}else{
return false
}
}
}
每當我嘗試編譯,我得到以下錯誤:
Error:(5, 5) Groovyc: Unknown type: METHOD_DEF at line: 5 column: 5. File: <SOMEFILE>
這句法一切看起來正確的我, 我究竟做錯了什麼?這是關閉的問題嗎?
我使用的IntelliJ 14.1.1 CE在Windows 7專業版
我正在使用Groovy 2.4.3 – Cayle
@Cayle this是不是使用任何新奇的14.1 groovy編譯選項? – cfrick
不知道,我沒有看到有關設置的任何東西。 – Cayle