Groovy @CompileStatic @CompileDynamic正在进行bananza。错误?

时间:2014-05-13 15:43:22

标签: grails groovy intellij-idea

import grails.transaction.Transactional
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic

@CompileStatic
@Transactional
abstract class BaseService<T> implements DefaultDomainServiceMethods<T> {
    DBService DBService

    @CompileDynamic
    boolean isNew(def domainInstance) {
        return !domainInstance.id
    }

}

在grails run-app

上导致以下错误
|Compiling 1 source files
.Error 
|
Compilation error: startup failed:
/samson/projects/samsongit/grails/samsonmain/grails-app/services/samson/BaseService.groovy: 14: [Static type checking] - No such property: id for class: java.lang.Object
 @ line 14, column 17.
           return !domainInstance.id
                   ^

1 error

显然@CompileDynamic不起作用。在grails run-app运行后更改此设置时,控制台会在错误消息循环中获取堆栈溢出。

Intellij不会报告任何错误。

0 个答案:

没有答案